Simplify user delete loop

This commit is contained in:
JonnyWong16 2020-04-10 13:27:26 -07:00
parent faac6b11c2
commit 104e2929df
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
2 changed files with 5 additions and 5 deletions

View file

@ -673,11 +673,10 @@ class Users(object):
# Get the user_ids corresponding to the row_ids
result = monitor_db.select('SELECT user_id FROM users '
'WHERE id IN ({})'.format(','.join(['?'] * len(row_ids))), row_ids)
user_ids = [user['user_id'] for user in result]
success = []
for user_id in user_ids:
success.append(self.delete(user_id=user_id, purge_only=purge_only))
for user in result:
success.append(self.delete(user_id=user['user_id'], purge_only=purge_only))
return all(success)
elif str(user_id).isdigit():