Research mode

- adds a new link on service settings page to switch service into/out of research mode
- platform admin only
- shows an indicator in the footer
This commit is contained in:
Martyn Inglis
2016-06-01 16:07:43 +01:00
parent f2cca024dd
commit c9297459e2
7 changed files with 188 additions and 24 deletions

View File

@@ -6,7 +6,6 @@ from app.notify_client import _attach_current_user
class ServiceAPIClient(NotificationsAPIClient):
# Fudge assert in the super __init__ so
# we can set those variables later.
def __init__(self):
@@ -81,6 +80,11 @@ class ServiceAPIClient(NotificationsAPIClient):
endpoint = "/service/{0}".format(service_id)
return self.post(endpoint, data)
def update_service_with_properties(self, service_id, properties):
_attach_current_user(properties)
endpoint = "/service/{0}".format(service_id)
return self.post(endpoint, properties)
def remove_user_from_service(self, service_id, user_id):
"""
Remove a user from a service
@@ -181,7 +185,6 @@ class ServiceAPIClient(NotificationsAPIClient):
class ServicesBrowsableItem(BrowsableItem):
@property
def title(self):
return self._item['name']