mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 05:59:44 -04:00
Sort services and orgs in presentation layer
The model layer shouldn’t need to be concerned with sorting. For services this means we can make a `SerialisedModelCollection` rather than writing a manual loop.
This commit is contained in:
@@ -293,9 +293,9 @@ class User(JSONModel, UserMixin):
|
||||
@property
|
||||
def services(self):
|
||||
from app.models.service import Service
|
||||
return sorted(
|
||||
return [
|
||||
Service(service) for service in self.orgs_and_services['services']
|
||||
)
|
||||
]
|
||||
|
||||
@property
|
||||
def services_with_organisation(self):
|
||||
|
||||
Reference in New Issue
Block a user