mirror of
https://github.com/zulip/zulip.git
synced 2025-10-30 19:43:47 +00:00
registration.py: Don't catch exception that can't be thrown.
A previous commit changed a `get` (which can throw `DoesNotExist`) to use an
existing object, but kept the `try` / `except` block:
4bf3ace444
Removing this unused code path allows us to achieve 100% test coverage.
This commit is contained in:
@@ -197,16 +197,10 @@ def accounts_register(request):
|
||||
|
||||
# FIXME: sanitize email addresses and fullname
|
||||
if existing_user_profile is not None and existing_user_profile.is_mirror_dummy:
|
||||
try:
|
||||
user_profile = existing_user_profile
|
||||
do_activate_user(user_profile)
|
||||
do_change_password(user_profile, password)
|
||||
do_change_full_name(user_profile, full_name)
|
||||
except UserProfile.DoesNotExist:
|
||||
user_profile = do_create_user(email, password, realm, full_name, short_name,
|
||||
prereg_user=prereg_user,
|
||||
tos_version=settings.TOS_VERSION,
|
||||
newsletter_data={"IP": request.META['REMOTE_ADDR']})
|
||||
user_profile = existing_user_profile
|
||||
do_activate_user(user_profile)
|
||||
do_change_password(user_profile, password)
|
||||
do_change_full_name(user_profile, full_name)
|
||||
else:
|
||||
user_profile = do_create_user(email, password, realm, full_name, short_name,
|
||||
prereg_user=prereg_user,
|
||||
|
||||
Reference in New Issue
Block a user