|
|
|
|
@ -44,7 +44,7 @@ class SchoolSchedule(models.Model): |
|
|
|
|
return dict(self.WEEKDAY_CHOICES).get(self.weekday, '') |
|
|
|
|
|
|
|
|
|
def is_online(self): |
|
|
|
|
end_at = datetime.combine(now().today(), self.start_at) + timedelta(hours=2) |
|
|
|
|
end_at = datetime.combine(now().today(), self.start_at) + timedelta(hours=1) |
|
|
|
|
return self.start_at <= now().time() and end_at.time() >= now().time() and self.weekday == now().isoweekday() |
|
|
|
|
|
|
|
|
|
def current_live_lesson(self): |
|
|
|
|
@ -132,5 +132,5 @@ class LiveLesson(BaseModel, DeactivatedMixin): |
|
|
|
|
return False |
|
|
|
|
else: |
|
|
|
|
start_at = school_schedule.start_at |
|
|
|
|
end_at = datetime.combine(now().today(), start_at) + timedelta(hours=2) |
|
|
|
|
end_at = datetime.combine(now().today(), start_at) + timedelta(hours=1) |
|
|
|
|
return start_at <= now().time() and end_at.time() >= now().time() |
|
|
|
|
|