From dede87c95e83068cfe1f9d284c5db475b50b72cc Mon Sep 17 00:00:00 2001 From: Katie Smith Date: Tue, 19 May 2020 11:33:19 +0100 Subject: [PATCH] Always add user to service using `User.add_to_service` The `_add_invited_user_to_service` function was calling the `user_api_client` directly to add a user to a service. It now calls the `add_to_service` method on the User model instead so that there is only one place in the code that calls the `user_api_client`. --- app/main/views/verify.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/main/views/verify.py b/app/main/views/verify.py index d9f2e331e..a417639ce 100644 --- a/app/main/views/verify.py +++ b/app/main/views/verify.py @@ -93,5 +93,5 @@ def _add_invited_user_to_service(invited_user): invitation = InvitedUser(invited_user) user = User.from_id(session['user_id']) service_id = invited_user['service'] - user_api_client.add_user_to_service(service_id, user.id, invitation.permissions, invitation.folder_permissions) + user.add_to_service(service_id, invitation.permissions, invitation.folder_permissions) return service_id