Skip to content

Commit

Permalink
BUG: Can't recreate a user with an email address that was previously …
Browse files Browse the repository at this point in the history
…removed. The email field is now nullified when deleting a user. Fixes #194
  • Loading branch information
n3tsurge committed Jun 16, 2022
1 parent 09d0f98 commit 63de29b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/api_v2/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ def delete(self, uuid, current_user):
user.deleted = True
random_identifier = ''.join(random.choice(string.ascii_lowercase) for i in range(5))
user.username = f"{user.username}-DELETED-{random_identifier}"
user.email = None
user.locked = True
user.save()
return {'message': 'User successfully deleted.'}
Expand Down

0 comments on commit 63de29b

Please sign in to comment.