Fix check lesson online

remotes/origin/hasaccess
Ivlev Denis 8 years ago
parent bcaec33874
commit cd0e5e5101
  1. 6
      project/views.py

@ -23,10 +23,10 @@ class IndexView(TemplateView):
except SchoolSchedule.DoesNotExist:
online = False
else:
end_at = datetime.combine(now().today(), school_schedule.start_at)
end_at = datetime.combine(now_time.today(), school_schedule.start_at)
online = (
school_schedule.start_at <= now().time() and
end_at + timedelta(hours=2) >= now() and
school_schedule.start_at <= now_time.time() and
(end_at + timedelta(hours=2)).time() >= now_time.time() and
school_schedule.current_live_lesson()
)

Loading…
Cancel
Save