- Fix tests to not hit remote Redis endpoint
- Fix convert organization to allow admin email address, in addition to username - Add test for the above
This commit is contained in:
parent
3ebdf2c062
commit
b0c4f5b2f5
4 changed files with 32 additions and 10 deletions
|
@ -296,7 +296,8 @@ class ConvertToOrganization(ApiResource):
|
|||
|
||||
# Ensure that the sign in credentials work.
|
||||
admin_password = convert_data['adminPassword']
|
||||
if not authentication.verify_user(admin_username, admin_password):
|
||||
admin_user = authentication.verify_user(admin_username, admin_password)
|
||||
if not admin_user:
|
||||
raise request_error(reason='invaliduser',
|
||||
message='The admin user credentials are not valid')
|
||||
|
||||
|
@ -306,7 +307,7 @@ class ConvertToOrganization(ApiResource):
|
|||
subscribe(user, plan, None, True) # Require business plans
|
||||
|
||||
# Convert the user to an organization.
|
||||
model.convert_user_to_organization(user, model.get_user(admin_username))
|
||||
model.convert_user_to_organization(user, admin_user)
|
||||
log_action('account_convert', user.username)
|
||||
|
||||
# And finally login with the admin credentials.
|
||||
|
|
Reference in a new issue