mirror of
https://github.com/GSA/notifications-admin.git
synced 2025-12-10 23:23:27 -05:00
Refactor user permissions to use args, not list
This makes the interface a bit cleaner and less verbose.
This commit is contained in:
@@ -92,10 +92,9 @@ def edit_user_permissions(service_id, user_id):
|
||||
user_has_no_mobile_number = user.mobile_number is None
|
||||
|
||||
form = PermissionsForm(
|
||||
**{role: user.has_permissions(permissions=permissions) for role, permissions in roles.items()},
|
||||
**{role: user.has_permissions(*permissions) for role, permissions in roles.items()},
|
||||
login_authentication=user.auth_type
|
||||
)
|
||||
|
||||
if form.validate_on_submit():
|
||||
user_api_client.set_user_permissions(
|
||||
user_id, service_id,
|
||||
@@ -122,7 +121,7 @@ def remove_user_from_service(service_id, user_id):
|
||||
# Need to make the email address read only, or a disabled field?
|
||||
# Do it through the template or the form class?
|
||||
form = PermissionsForm(**{
|
||||
role: user.has_permissions(permissions=permissions) for role, permissions in roles.items()
|
||||
role: user.has_permissions(*permissions) for role, permissions in roles.items()
|
||||
})
|
||||
|
||||
if request.method == 'POST':
|
||||
|
||||
Reference in New Issue
Block a user