remotes/origin/hotfix/LIL-661
gzbender 8 years ago
parent 3183339605
commit 4312b61e3b
  1. 7
      apps/school/views.py

@ -133,11 +133,15 @@ class SchoolView(TemplateView):
school_schedule.current_live_lesson()
)
school_schedules = SchoolSchedule.objects.all()
try:
school_schedules = sorted(school_schedules, key=lambda ss: ss.current_live_lesson and ss.current_live_lesson.date)
except Exception:
pass
school_schedules_dict = {ss.weekday: ss for ss in school_schedules}
school_schedules_dict[0] = school_schedules_dict.get(7)
all_schedules_purchased = []
if self.request.user.is_authenticated:
school_schedules = sorted(SchoolSchedule.objects.all(), key=lambda ss: ss.current_live_lesson.date)
all_schedules_purchased = SchoolPayment.objects.filter(
user=self.request.user,
status__in=[
@ -181,7 +185,6 @@ class SchoolView(TemplateView):
joined_weekdays=Func(F('weekdays'), function='unnest',)
).values_list('joined_weekdays', flat=True).distinct()
else:
school_schedules = SchoolSchedule.objects.all()
school_payment_exists = False
school_payment_exists_future = False
school_purchased_future = False

Loading…
Cancel
Save