diff --git a/zephyr/models.py b/zephyr/models.py index e881bf5c1c..37a2d1a13e 100644 --- a/zephyr/models.py +++ b/zephyr/models.py @@ -98,7 +98,6 @@ 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) diff --git a/zephyr/views.py b/zephyr/views.py index 84039b8797..3172620042 100644 --- a/zephyr/views.py +++ b/zephyr/views.py @@ -167,15 +167,16 @@ def zephyr(request): @login_required @require_post def forge_zephyr(request): - email = sanitize_identifier(request.POST['sender']) + email = sanitize_identifier(request.POST['sender']).lower() user_profile = UserProfile.objects.get(user=request.user) try: user = User.objects.get(email=email) except User.DoesNotExist: # forge a user for this person - user = create_user(email, "test", user_profile.realm, - sanitize_identifier(request.POST['fullname']), - sanitize_identifier(request.POST['shortname'])) + create_user(email, "test", user_profile.realm, + sanitize_identifier(request.POST['fullname']), + sanitize_identifier(request.POST['shortname'])) + user = User.objects.get(email=email) return zephyr_backend(request, user)