Skip to content

Commit

Permalink
[oldimporter] Fixed exception in import_admins
Browse files Browse the repository at this point in the history
  • Loading branch information
nemesifier committed Oct 16, 2015
1 parent a4a6cb2 commit 2d7adf5
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -355,7 +355,7 @@ def import_admins(self):

for olduser in OldUser.objects.all():
try:
user = User.objects.get(username=olduser.username)
user = User.objects.get(Q(username=olduser.username) | Q(email=olduser.email))
except User.DoesNotExist:
user = User()
user.username = olduser.username
Expand Down Expand Up @@ -455,12 +455,12 @@ def import_users(self):
user = User.objects.get(email=email)
# otherwise report error
else:
user = None
tb = traceback.format_exc()
self.message('Could not save user %s, got exception:\n\n%s' % (user.username, tb))
continue

# if we got a user to add
if user is not None:
if user:
# store id
self.users_dict[email]['id'] = user.id
# append to saved users
Expand Down

0 comments on commit 2d7adf5

Please sign in to comment.