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
No related merge requests found
...@@ -60,8 +60,9 @@ class PlanScreenView(PlanIndexView): ...@@ -60,8 +60,9 @@ class PlanScreenView(PlanIndexView):
def get_queryset(self): def get_queryset(self):
# Determine interesting range (some hours ago until some hours in the future as specified in the settings) # 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: now = datetime.now().astimezone(self.event.timezone)
self.start = datetime.now().astimezone(self.event.timezone) - timedelta(hours=settings.PLAN_WALL_HOURS_RETROSPECT) if self.event.start < now < self.event.end:
self.start = now - timedelta(hours=settings.PLAN_WALL_HOURS_RETROSPECT)
else: else:
self.start = self.event.start self.start = self.event.start
self.end = self.event.end 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