Skip to content
Snippets Groups Projects
Commit f30ed7e6 authored by Sofia Papagiannaki's avatar Sofia Papagiannaki
Browse files

Fix infinite loop in case another user with the same email already exists

parent e8c77add
No related branches found
No related tags found
No related merge requests found
...@@ -498,13 +498,8 @@ class AstakosUser(User): ...@@ -498,13 +498,8 @@ class AstakosUser(User):
if not self.id: if not self.id:
# set username # set username
while not self.username: self.username = self.email
username = self.email
try:
AstakosUser.objects.get(username=username)
except AstakosUser.DoesNotExist:
self.username = username
self.validate_unique_email_isactive() self.validate_unique_email_isactive()
if self.is_active and self.activation_sent: if self.is_active and self.activation_sent:
# reset the activation sent # reset the activation sent
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment