mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-16 20:49:00 -04:00
Delete caches when user accepts invite
Accepting an invite changes: - the `user_to_service` list of users returned by `GET /service/<id>` - the `services` list return by `GET /user/<id>` The latter change is causing the functional tests to fail.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from app.notify_client import NotifyAdminAPIClient, _attach_current_user
|
||||
from app.notify_client import NotifyAdminAPIClient, _attach_current_user, cache
|
||||
from app.notify_client.models import (
|
||||
InvitedUser,
|
||||
translate_permissions_from_admin_roles_to_db,
|
||||
@@ -44,6 +44,8 @@ class InviteApiClient(NotifyAdminAPIClient):
|
||||
self.post(url='/service/{0}/invite/{1}'.format(service_id, invited_user_id),
|
||||
data=data)
|
||||
|
||||
@cache.delete('service')
|
||||
@cache.delete('user', key_from_args=[1])
|
||||
def accept_invite(self, service_id, invited_user_id):
|
||||
data = {'status': 'accepted'}
|
||||
self.post(url='/service/{0}/invite/{1}'.format(service_id, invited_user_id),
|
||||
|
||||
Reference in New Issue
Block a user