Refactor create organisation code into model

So the view layer is cleaner.
This commit is contained in:
Chris Hill-Scott
2019-07-02 10:01:29 +01:00
parent 1c02e611e4
commit 44a78d3cd1
3 changed files with 33 additions and 17 deletions

View File

@@ -32,11 +32,16 @@ class OrganisationsClient(NotifyAdminAPIClient):
raise error
@cache.delete('organisations')
def create_organisation(self, name):
data = {
"name": name
}
return self.post(url="/organisations", data=data)
def create_organisation(self, name, crown, organisation_type, agreement_signed):
return self.post(
url="/organisations",
data={
"name": name,
"crown": crown,
"organisation_type": organisation_type,
"agreement_signed": agreement_signed,
}
)
@cache.delete('domains')
@cache.delete('organisations')