Return services serialized for dashboard for orgs

- rather than returning the entire service, return only whats needed when listing the service on the org dashboard
This commit is contained in:
Ken Tsang
2018-02-13 09:28:48 +00:00
parent 085110417f
commit d80c7d4f65
3 changed files with 52 additions and 5 deletions

View File

@@ -344,6 +344,15 @@ class Service(db.Model, Versioned):
def has_permission(self, permission):
return permission in [p.permission for p in self.permissions]
def serialize_for_org_dashboard(self):
return {
'id': str(self.id),
'name': self.name,
'active': self.active,
'restricted': self.restricted,
'research_mode': self.research_mode
}
class AnnualBilling(db.Model):
__tablename__ = "annual_billing"