From afe4279e5fb688a7318d79ac530fe7610559928b Mon Sep 17 00:00:00 2001 From: Chris Meyers Date: Thu, 22 Apr 2021 13:40:30 -0400 Subject: [PATCH] fix running analytics for the first time --- awx/main/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/main/tasks.py b/awx/main/tasks.py index 063b5f47d7..09ea552e6b 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -381,7 +381,7 @@ def gather_analytics(): from rest_framework.fields import DateTimeField last_gather = Setting.objects.filter(key='AUTOMATION_ANALYTICS_LAST_GATHER').first() - last_time = DateTimeField().to_internal_value(last_gather.value) if last_gather else None + last_time = DateTimeField().to_internal_value(last_gather.value) if last_gather and last_gather.value else None gather_time = now() if not last_time or ((gather_time - last_time).total_seconds() > settings.AUTOMATION_ANALYTICS_GATHER_INTERVAL):