Prevent organizations from attempting an account recovery.
This commit is contained in:
parent
1f8a82eefe
commit
223d2ebaf1
3 changed files with 8 additions and 3 deletions
|
@ -350,6 +350,9 @@ def create_reset_password_email_code(email):
|
|||
except User.DoesNotExist:
|
||||
raise InvalidEmailAddressException('Email address was not found.');
|
||||
|
||||
if user.organization:
|
||||
raise InvalidEmailAddressException('Organizations can not have passwords.')
|
||||
|
||||
code = EmailConfirmation.create(user=user, pw_reset=True)
|
||||
return code
|
||||
|
||||
|
|
Reference in a new issue