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

@@ -12,6 +12,12 @@ class JSONModel():
def __bool__(self):
return self._dict != {}
def __hash__(self):
return hash(self.id)
def __eq__(self, other):
return self.id == other.id
def __getattr__(self, attr):
if attr in self.ALLOWED_PROPERTIES:
return self._dict[attr]