Use new API endpoint for scheduled job stats

Depends on:
- [ ] https://github.com/alphagov/notifications-api/pull/2984
This commit is contained in:
Chris Hill-Scott
2020-09-28 14:28:23 +01:00
parent 65e32f8e5a
commit ef6681b69b
7 changed files with 103 additions and 32 deletions

View File

@@ -151,6 +151,12 @@ class Service(JSONModel):
return []
return ScheduledJobs(self.id)
@cached_property
def scheduled_job_stats(self):
if not self.has_jobs:
return {'count': 0}
return job_api_client.get_scheduled_job_stats(self.id)
@cached_property
def invited_users(self):
return InvitedUsers(self.id)