mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-05 08:31:00 -04:00
Use template_type property directly from API
It’s included in the job/upload response now[1]. So we don’t need to fetch the template every time we want to access it. 1. https://github.com/alphagov/notifications-api/pull/2728
This commit is contained in:
@@ -30,6 +30,7 @@ class Job(JSONModel):
|
||||
'processing_started',
|
||||
'notification_count',
|
||||
'created_by',
|
||||
'template_type',
|
||||
}
|
||||
|
||||
@classmethod
|
||||
@@ -132,10 +133,6 @@ class Job(JSONModel):
|
||||
version=self.template_version,
|
||||
)['data']
|
||||
|
||||
@property
|
||||
def template_type(self):
|
||||
return self.template['template_type']
|
||||
|
||||
@property
|
||||
def percentage_complete(self):
|
||||
return self.notifications_requested / self.notification_count * 100
|
||||
|
||||
Reference in New Issue
Block a user