mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-05 08:31:00 -04:00
Use service model to look up service attributes
This is better than just keying into the JSON because it means you get an exception straight away when looking up a key that doesn’t exist (which via mocking you could ordinarily miss).
This commit is contained in:
@@ -47,7 +47,7 @@ class NotifyAdminAPIClient(BaseAPIClient):
|
||||
|
||||
# if the current service is inactive and the user isn't a platform admin, we should block them from making any
|
||||
# stateful modifications to that service
|
||||
if current_service and not current_service['active'] and not current_user.platform_admin:
|
||||
if current_service and not current_service.active and not current_user.platform_admin:
|
||||
abort(403)
|
||||
|
||||
def post(self, *args, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user