|
|
|
|
@ -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, |
|
|
|
|
|