File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -65,10 +65,7 @@ def service_dashboard(service_id):
6565 active_jobs = [job for job in job_response if job ["job_status" ] != "cancelled" ]
6666 sorted_jobs = sorted (active_jobs , key = lambda job : job ["created_at" ], reverse = True )
6767 job_lists = [
68- {
69- ** job_dict ,
70- "finished_processing" : job_is_finished (job_dict )
71- }
68+ {** job_dict , "finished_processing" : job_is_finished (job_dict )}
7269 for job_dict in sorted_jobs
7370 ]
7471
@@ -91,7 +88,7 @@ def job_is_finished(job_dict):
9188 "technical-failure" ,
9289 "temporary-failure" ,
9390 "permanent-failure" ,
94- "cancelled"
91+ "cancelled" ,
9592 ]
9693
9794 processed_count = sum (
Original file line number Diff line number Diff line change @@ -128,6 +128,13 @@ def generate_notifications_csv(**kwargs):
128128 notifications_resp = notification_api_client .get_notifications_for_service (
129129 ** kwargs
130130 )
131+ # Stop if we are finished
132+ if (
133+ notifications_resp .get ("notifications" ) is None
134+ or len (notifications_resp ["notifications" ]) == 0
135+ ):
136+ return
137+
131138 for notification in notifications_resp ["notifications" ]:
132139 preferred_tz_created_at = convert_report_date_to_preferred_timezone (
133140 notification ["created_at" ]
You can’t perform that action at this time.
0 commit comments