mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-17 10:07:04 +02:00
handle none
This commit is contained in:
parent
fda2c11fb1
commit
33b47d27d1
1 changed files with 4 additions and 1 deletions
|
@ -376,6 +376,9 @@ def analytics(request):
|
||||||
approval_time=F("approved_domain__created_at") - F("submission_date")
|
approval_time=F("approved_domain__created_at") - F("submission_date")
|
||||||
).aggregate(Avg("approval_time"))["approval_time__avg"]
|
).aggregate(Avg("approval_time"))["approval_time__avg"]
|
||||||
# Format the timedelta to display only days
|
# Format the timedelta to display only days
|
||||||
|
|
||||||
|
avg_approval_time="No approvals to use"
|
||||||
|
if avg_approval_time is not None:
|
||||||
avg_approval_time = f"{avg_approval_time.days} days"
|
avg_approval_time = f"{avg_approval_time.days} days"
|
||||||
|
|
||||||
# The start and end dates are passed as url params
|
# The start and end dates are passed as url params
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue