mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-05 21:48:26 -04:00
Fix bug with creating the invited user permission list.
This commit is contained in:
@@ -60,7 +60,9 @@ def invite_user(service_id):
|
|||||||
# view_activity is a default role to be added to all users.
|
# view_activity is a default role to be added to all users.
|
||||||
# All users will have at minimum view_activity to allow users to see notifications,
|
# All users will have at minimum view_activity to allow users to see notifications,
|
||||||
# templates, team members but no update privileges
|
# templates, team members but no update privileges
|
||||||
permissions = ','.join(role for role in roles.keys() if request.form.get(role) == 'y').join('view_activity')
|
selected_permissions = [role for role in roles.keys() if request.form.get(role) == 'y']
|
||||||
|
selected_permissions.append('view_activity')
|
||||||
|
permissions = ','.join(selected_permissions)
|
||||||
invited_user = invite_api_client.create_invite(
|
invited_user = invite_api_client.create_invite(
|
||||||
current_user.id,
|
current_user.id,
|
||||||
service_id,
|
service_id,
|
||||||
|
|||||||
@@ -161,6 +161,10 @@ def test_invite_user(
|
|||||||
assert page.h1.string.strip() == 'Manage team'
|
assert page.h1.string.strip() == 'Manage team'
|
||||||
flash_banner = page.find('div', class_='banner-default-with-tick').string.strip()
|
flash_banner = page.find('div', class_='banner-default-with-tick').string.strip()
|
||||||
assert flash_banner == 'Invite sent to test@example.gov.uk'
|
assert flash_banner == 'Invite sent to test@example.gov.uk'
|
||||||
|
app.invite_api_client.create_invite.assert_called_once_with(sample_invite['from_user'],
|
||||||
|
sample_invite['service'],
|
||||||
|
email_address,
|
||||||
|
sample_invite['permissions']+',view_activity')
|
||||||
|
|
||||||
|
|
||||||
def test_cancel_invited_user_cancels_user_invitations(app_,
|
def test_cancel_invited_user_cancels_user_invitations(app_,
|
||||||
|
|||||||
Reference in New Issue
Block a user