Set email on forged users

(imported from commit ee7c163bf2a674c8b76aa5a7ba86e79c84bcec20)
This commit is contained in:
Keegan McAllister 2012-09-12 22:55:37 -04:00
parent c3c675a872
commit 96abc04fe6
1 changed files with 2 additions and 1 deletions

View File

@ -160,7 +160,8 @@ def forge_zephyr(request):
user = User.objects.get(username=username)
except User.DoesNotExist:
# forge a user for this person
user = User.objects.create_user(username=username, password="test")
user = User.objects.create_user(username=username, password="test",
email=(username if '@' in username else ''))
user.save()
create_user_profile(user, user_profile.realm,
request.POST['fullname'], request.POST['shortname'])