Merge pull request #3658 from alphagov/use-scheduled-job-stats

Use new API endpoint for scheduled job stats
This commit is contained in:
Chris Hill-Scott
2020-10-06 12:00:38 +01:00
committed by GitHub
7 changed files with 105 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)