Make a model collection for services

This is tidier than having a manual loop.
This commit is contained in:
Chris Hill-Scott
2021-09-27 15:20:56 +01:00
parent 9281ca7d50
commit cbbc58e649
2 changed files with 7 additions and 4 deletions

View File

@@ -292,10 +292,8 @@ class User(JSONModel, UserMixin):
@property
def services(self):
from app.models.service import Service
return [
Service(service) for service in self.orgs_and_services['services']
]
from app.models.service import Services
return Services(self.orgs_and_services['services'])
@property
def services_with_organisation(self):