mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-14 23:08:07 -04:00
Add confirmation banner when cancelling user invites
This shows the green banner with a tick when cancelling a user's invitation to a service or organisation. The accessibility audit noted that 'When cancelling an invite a new page loads, however, there is no immediate indication that the invite has been cancelled.' In order to display the invited user's email address as part of the flash message, this adds new methods to the api clients for invites to get a single invite.
This commit is contained in:
@@ -464,6 +464,12 @@ class InvitedUser(JSONModel):
|
||||
folder_permissions,
|
||||
))
|
||||
|
||||
@classmethod
|
||||
def by_id_and_service_id(cls, service_id, invited_user_id):
|
||||
return cls(
|
||||
invite_api_client.get_invited_user(service_id, invited_user_id)
|
||||
)
|
||||
|
||||
def accept_invite(self):
|
||||
invite_api_client.accept_invite(self.service, self.id)
|
||||
|
||||
@@ -586,6 +592,12 @@ class InvitedOrgUser(JSONModel):
|
||||
invited_org_user = session.get('invited_org_user')
|
||||
return cls(invited_org_user) if invited_org_user else None
|
||||
|
||||
@classmethod
|
||||
def by_id_and_org_id(cls, org_id, invited_user_id):
|
||||
return cls(
|
||||
org_invite_api_client.get_invited_user(org_id, invited_user_id)
|
||||
)
|
||||
|
||||
def serialize(self, permissions_as_string=False):
|
||||
data = {'id': self.id,
|
||||
'organisation': self.organisation,
|
||||
|
||||
Reference in New Issue
Block a user