Commit ce41872 1 parent ce1f602 commit ce41872 Copy full SHA for ce41872
File tree 1 file changed +3
-2
lines changed
components/resc-backend/src/resc_backend/resc_web_service/endpoints
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -187,8 +187,9 @@ def get_audit_count_by_auditor_over_time(db_connection: Session = Depends(get_db
187
187
# set the counts based on the data from the database
188
188
for audit in audit_counts :
189
189
audit_week = f"{ audit ['year' ]} W{ audit ['week' ]:02d} "
190
- weekly_audit_counts .get (audit_week ).audit_by_auditor_count [audit ['auditor' ]] = audit ['audit_count' ]
191
- weekly_audit_counts .get (audit_week ).total += audit ['audit_count' ]
190
+ if audit_week in weekly_audit_counts :
191
+ weekly_audit_counts .get (audit_week ).audit_by_auditor_count [audit ['auditor' ]] = audit ['audit_count' ]
192
+ weekly_audit_counts .get (audit_week ).total += audit ['audit_count' ]
192
193
193
194
sorted_weekly_audit_counts = dict (sorted (weekly_audit_counts .items ()))
194
195
output = list (sorted_weekly_audit_counts .values ())
You can’t perform that action at this time.
0 commit comments