Better UX when recovering organization emails

Fixes #291
This commit is contained in:
Joseph Schorr 2015-12-28 15:25:31 -05:00
parent 16f16e8a15
commit 31a8a0fba4
7 changed files with 76 additions and 11 deletions

View file

@ -72,6 +72,9 @@ def __get_org_admin_users(org):
.where(Team.organization == org, TeamRole.name == 'admin', User.robot == False)
.distinct())
def get_admin_users(org):
""" Returns the owner users for the organization. """
return __get_org_admin_users(org)
def remove_organization_member(org, user_obj):
org_admins = [u.username for u in __get_org_admin_users(org)]

View file

@ -402,7 +402,7 @@ def create_reset_password_email_code(email):
try:
user = User.get(User.email == email)
except User.DoesNotExist:
raise InvalidEmailAddressException('Email address was not found.');
raise InvalidEmailAddressException('Email address was not found.')
if user.organization:
raise InvalidEmailAddressException('Organizations can not have passwords.')