Subversion Repositories SmartDukaan

Rev

Rev 15134 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15134 Rev 15136
Line 26... Line 26...
26
            users = Users.query.filter(Users.id.in_(record_data[0]))
26
            users = Users.query.filter(Users.id.in_(record_data[0]))
27
            existingGroupId = 0
27
            existingGroupId = 0
28
            for user in users:
28
            for user in users:
29
                if user.userGroupId and user.userGroupId >0:
29
                if user.userGroupId and user.userGroupId >0:
30
                    existingGroupId = user.userGroupId
30
                    existingGroupId = user.userGroupId
31
                    break
31
                    
32
            if existingGroupId >0:
32
            if existingGroupId >0:
33
                checkForExistingUserGroup = "select * from usergroup where id=%d"%(existingGroupId)
33
                checkForExistingUserGroup = "select * from usergroup where id=%d"%(existingGroupId)
34
                cursor.execute(checkForExistingUserGroup)
34
                cursor.execute(checkForExistingUserGroup)
35
                existingUserGroup = cursor.fetchone()
35
                existingUserGroup = cursor.fetchone()
36
                updateUserGroup = "update usergroup set user_ids ='%s', mobileNos ='%s', imeis ='%s', referrers ='%s' where id = %d"%(record_data[0], record_data[1], record_data[2], record_data[3], existingUserGroup[0])
36
                updateUserGroup = "update usergroup set user_ids ='%s', mobileNos ='%s', imeis ='%s', referrers ='%s' where id = %d"%(record_data[0], record_data[1], record_data[2], record_data[3], existingUserGroup[0])