Update coming soon live lesson block in promo

remotes/origin/hasaccess
Ivlev Denis 8 years ago
parent 75e7d097b3
commit 74c8edf6cf
  1. 2
      apps/school/models.py
  2. 7
      project/views.py

@ -68,7 +68,7 @@ class SchoolSchedule(models.Model):
@property
def start_at_humanize(self):
return arrow.get(self.start_at).humanize(locale='ru') if self.start_at else None
return arrow.get(datetime.combine(datetime.today(), self.start_at)).humanize(locale='ru') if self.start_at else None
class SchoolScheduleImage(models.Model):

@ -37,8 +37,10 @@ class IndexView(TemplateView):
school_schedule.current_live_lesson()
)
online_coming_soon = (
school_schedule.start_at < now_time.time() and
(school_schedule.start_at - timedelta(hours=5)).time() >= now_time.time() and
school_schedule.start_at > now_time.time() and
(
datetime.combine(datetime.today(), school_schedule.start_at) - timedelta(hours=5)
).time() <= now_time.time() and
school_schedule.current_live_lesson()
)
@ -71,6 +73,7 @@ class IndexView(TemplateView):
context.update({
'online': online,
'online_coming_soon': online_coming_soon,
'school_schedule': school_schedule,
'course_items': Course.objects.filter(status=Course.PUBLISHED)[:6],
'is_purchased': school_payment_exists,
'min_school_price': SchoolSchedule.objects.aggregate(Min('month_price'))['month_price__min'],

Loading…
Cancel
Save