mirror of https://github.com/zulip/zulip.git
Get the just-created user from create_user
(imported from commit d709c99cc670aa1b0864c40b8c0d5e52b6c90340)
This commit is contained in:
parent
0638c2aada
commit
a68a3e7ab7
|
@ -98,6 +98,7 @@ def create_user(email, password, realm, full_name, short_name):
|
|||
email=email)
|
||||
user.save()
|
||||
UserProfile.create(user, realm, full_name, short_name)
|
||||
return user
|
||||
|
||||
class ZephyrClass(models.Model):
|
||||
name = models.CharField(max_length=30, db_index=True)
|
||||
|
|
|
@ -173,10 +173,9 @@ def forge_zephyr(request):
|
|||
user = User.objects.get(email=email)
|
||||
except User.DoesNotExist:
|
||||
# forge a user for this person
|
||||
create_user(email, "test", user_profile.realm,
|
||||
sanitize_identifier(request.POST['fullname']),
|
||||
sanitize_identifier(request.POST['shortname']))
|
||||
user = User.objects.get(email=email)
|
||||
user = create_user(email, "test", user_profile.realm,
|
||||
sanitize_identifier(request.POST['fullname']),
|
||||
sanitize_identifier(request.POST['shortname']))
|
||||
|
||||
return zephyr_backend(request, user)
|
||||
|
||||
|
|
Loading…
Reference in New Issue