Skip to content
Snippets Groups Projects
Commit 3be4dac9 authored by Benjamin Hättasch's avatar Benjamin Hättasch
Browse files

Calculate current timezone-aware time only once in AKWall view

parent 09297a8c
No related branches found
No related tags found
1 merge request!20Restrict AKWall to dates belonging to the corresponding event
This commit is part of merge request !20. Comments created here will be created in the context of that merge request.
......@@ -60,8 +60,9 @@ class PlanScreenView(PlanIndexView):
def get_queryset(self):
# Determine interesting range (some hours ago until some hours in the future as specified in the settings)
if self.event.start < datetime.now().astimezone(self.event.timezone) < self.event.end:
self.start = datetime.now().astimezone(self.event.timezone) - timedelta(hours=settings.PLAN_WALL_HOURS_RETROSPECT)
now = datetime.now().astimezone(self.event.timezone)
if self.event.start < now < self.event.end:
self.start = now - timedelta(hours=settings.PLAN_WALL_HOURS_RETROSPECT)
else:
self.start = self.event.start
self.end = self.event.end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment