summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorParker Berberian <pberberian@iol.unh.edu>2019-01-22 11:54:12 -0500
committerParker Berberian <pberberian@iol.unh.edu>2019-01-22 11:54:12 -0500
commit93ac1cd683998a10c408069f72c421673f7ddfee (patch)
treef09bf1254a0035ba7c05d135714ffcd40c1f53a0
parent6cf23538ed88c3ff163f7959bb53d0138c445669 (diff)
Fixed timezone issue in the Snapshot Workflow
The snapshot workflow was using the python datetime module directly, which breaks on the strict timezone requirements of the live dashboard. This commit uses the django timezone module instead Change-Id: I04b43b127bd3d8eb8ac72aa9c84e24a5f154a880 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
-rw-r--r--dashboard/src/workflow/snapshot_workflow.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/dashboard/src/workflow/snapshot_workflow.py b/dashboard/src/workflow/snapshot_workflow.py
index 0d53ed4..002aee5 100644
--- a/dashboard/src/workflow/snapshot_workflow.py
+++ b/dashboard/src/workflow/snapshot_workflow.py
@@ -8,7 +8,7 @@
##############################################################################
-import datetime
+from django.utils import timezone
import json
from booking.models import Booking
@@ -27,7 +27,7 @@ class Select_Host_Step(WorkflowStep):
context = super(Select_Host_Step, self).get_context()
context['form'] = SnapshotHostSelectForm()
booking_hosts = {}
- now = datetime.datetime.now()
+ now = timezone.now()
user = self.repo_get(self.repo.SESSION_USER)
bookings = Booking.objects.filter(start__lt=now, end__gt=now, owner=user)
for booking in bookings: