Stop making multiple API calls to get_organisation

The count of live services is coming back from the `/organisations`
response. We don’t need to get each organisation individually now.
This commit is contained in:
Chris Hill-Scott
2019-06-17 16:09:58 +01:00
parent e6304fe10d
commit 290e111810
2 changed files with 7 additions and 5 deletions

View File

@@ -294,7 +294,7 @@ class User(JSONModel, UserMixin):
@property
def organisations(self):
return [
Organisation.from_id(organisation['id'])
Organisation(organisation)
for organisation in self.orgs_and_services['organisations']
]