Use new fields for getting orgs and services

Uses https://github.com/alphagov/notifications-api/pull/2539 to reduce
the number of API calls we make.
This commit is contained in:
Chris Hill-Scott
2019-06-12 12:09:26 +01:00
parent da29d722f9
commit 0aea038d51
11 changed files with 165 additions and 138 deletions

View File

@@ -402,6 +402,10 @@ class Service(JSONModel):
def organisation(self):
return Organisation.from_service(self.id)
@property
def organisation_id(self):
return self._dict['organisation']
@cached_property
def inbound_number(self):
return inbound_number_client.get_inbound_sms_number_for_service(self.id)['data'].get('number', '')