mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 14:29:51 -04:00
Account for missing scheduled for field
Jobs have a `scheduled_for` field. Single letter uploads don’t. At the moment we treat both of them as `Job`s. So the `Job` model needs to account for when the `scheduled_for` field is missing.
This commit is contained in:
@@ -26,7 +26,6 @@ class Job(JSONModel):
|
||||
'notification_count',
|
||||
'job_status',
|
||||
'created_by',
|
||||
'scheduled_for',
|
||||
}
|
||||
|
||||
@classmethod
|
||||
@@ -45,6 +44,10 @@ class Job(JSONModel):
|
||||
def scheduled(self):
|
||||
return self.status == 'scheduled'
|
||||
|
||||
@property
|
||||
def scheduled_for(self):
|
||||
return self._dict.get('scheduled_for')
|
||||
|
||||
def _aggregate_statistics(self, *statuses):
|
||||
return sum(
|
||||
outcome['count'] for outcome in self._dict['statistics']
|
||||
|
||||
Reference in New Issue
Block a user