Add usage stats to organisation page.

This commit is contained in:
Rebecca Law
2020-02-25 17:49:55 +00:00
parent 07e7d98407
commit 4b11d776ee
6 changed files with 44 additions and 14 deletions

View File

@@ -5,6 +5,7 @@ from app.models import JSONModel, ModelList
from app.notify_client.email_branding_client import email_branding_client
from app.notify_client.letter_branding_client import letter_branding_client
from app.notify_client.organisations_api_client import organisations_client
from app.utils import get_current_financial_year
class Organisation(JSONModel):
@@ -198,6 +199,9 @@ class Organisation(JSONModel):
self.id
)
def services_and_usage(self):
return organisations_client.get_services_and_usage(self.id, get_current_financial_year())
class Organisations(ModelList):
client_method = organisations_client.get_organisations