mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-23 09:29:14 -04:00
Move some methods from the API client to the model
They make more sense being on the model, and it doesn’t make any sense to duplicate them.
This commit is contained in:
@@ -195,18 +195,5 @@ class UserApiClient(NotifyAdminAPIClient):
|
||||
), [])
|
||||
return sorted(all_services, key=lambda service: service['name'])
|
||||
|
||||
def user_has_live_services(self, user):
|
||||
return any(
|
||||
not service['restricted'] for service in self.get_services_for_user(user)
|
||||
)
|
||||
|
||||
def get_service_ids_for_user(self, user):
|
||||
return {
|
||||
service['id'] for service in self.get_services_for_user(user)
|
||||
}
|
||||
|
||||
def user_belongs_to_service(self, user, service_id):
|
||||
return str(service_id) in self.get_service_ids_for_user(user)
|
||||
|
||||
|
||||
user_api_client = UserApiClient()
|
||||
|
||||
Reference in New Issue
Block a user