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