Update check online

remotes/origin/hasaccess
Ivlev Denis 8 years ago
parent 0abe6f7058
commit 184a3913ea
  1. 8
      project/views.py

@ -1,3 +1,5 @@
from datetime import timedelta
from django.db.models import Min
from django.contrib.auth import get_user_model
from django.views.generic import TemplateView
@ -21,7 +23,11 @@ class IndexView(TemplateView):
except SchoolSchedule.DoesNotExist:
online = False
else:
online = school_schedule.start_at <= now().time() and school_schedule.current_live_lesson()
online = (
school_schedule.start_at <= now().time() and
school_schedule.start_at + timedelta(hours=2) and
school_schedule.current_live_lesson()
)
context.update({
'online': online,

Loading…
Cancel
Save