mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 18:01:08 -05:00
cleanup
This commit is contained in:
@@ -835,13 +835,9 @@ def create_new_service(name, message_limit, restricted, email_from, created_by_i
|
||||
@notify_command(name="promote-user-to-platform-admin")
|
||||
@click.option("-u", "--user-email-address", required=True, prompt=True)
|
||||
def promote_user_to_platform_admin(user_email_address):
|
||||
print("enter")
|
||||
# If the email address is wrong, sqlalchemy will automatically raise a NoResultFound error which is what we want.
|
||||
# See tests.
|
||||
user = get_user_by_email(user_email_address)
|
||||
print(f"user is {user}")
|
||||
# if not user:
|
||||
# raise ValueError(f"could not find user for {user_email_address}")
|
||||
print("ok to proceed")
|
||||
user.platform_admin = True
|
||||
db.session.add(user)
|
||||
db.session.commit()
|
||||
print("finished")
|
||||
|
||||
@@ -405,14 +405,13 @@ def test_promote_user_to_platform_admin(
|
||||
assert sample_user.platform_admin is False
|
||||
assert sample_platform_admin.platform_admin is True
|
||||
|
||||
result = notify_api.test_cli_runner().invoke(
|
||||
notify_api.test_cli_runner().invoke(
|
||||
promote_user_to_platform_admin,
|
||||
[
|
||||
"-u",
|
||||
"notify@digital.fake.gov",
|
||||
],
|
||||
)
|
||||
print(result)
|
||||
|
||||
user = get_user_by_email("notify@digital.fake.gov")
|
||||
assert user.platform_admin is True
|
||||
|
||||
Reference in New Issue
Block a user