merge master

This commit is contained in:
venusbb
2017-08-11 09:36:05 +01:00
29 changed files with 863 additions and 150 deletions

View File

@@ -19,3 +19,19 @@ class OrganisationsClient(NotifyAdminAPIClient):
def get_letter_organisations(self):
return self.get(url='/dvla_organisations')
def create_organisation(self, logo, name, colour):
data = {
"logo": logo,
"name": name,
"colour": colour
}
return self.post(url="/organisation", data=data)
def update_organisation(self, org_id, logo, name, colour):
data = {
"logo": logo,
"name": name,
"colour": colour
}
return self.post(url="/organisation/{}".format(org_id), data=data)

View File

@@ -216,9 +216,13 @@ class ServiceAPIClient(NotifyAdminAPIClient):
data = _attach_current_user(data)
return self.post(endpoint, data=data)
def find_all_service_email_from(self, user_id=None):
resp = self.get_services(user_id)
return [x['email_from'] for x in resp['data']]
def is_service_name_unique(self, name, email_from):
"""
Check that the service name or email from are unique across all services.
"""
endpoint = "/service/unique"
params = {"name": name, "email_from": email_from}
return self.get(url=endpoint, params=params)["result"]
# Temp access of service history data. Includes service and api key history
def get_service_history(self, service_id):