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
......@@ -498,13 +498,8 @@ class AstakosUser(User):
if not self.id:
# set username
while not self.username:
username = self.email
try:
AstakosUser.objects.get(username=username)
except AstakosUser.DoesNotExist:
self.username = username
self.username = self.email
self.validate_unique_email_isactive()
if self.is_active and self.activation_sent:
# reset the activation sent
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment