Fix show live lesson button on main page

remotes/origin/feature/effective_amount
Ivlev Denis 8 years ago
parent 8e36f57f62
commit 40656cf63b
  1. 4
      project/views.py

@ -37,7 +37,9 @@ class IndexView(TemplateView):
date_now = now_time.date()
if self.request.user.is_authenticated:
schoolpayment_queryset = self.request.user.school_payments()
school_payment_exists = schoolpayment_queryset.exists()
school_payment_exists = schoolpayment_queryset.filter(
weekdays__contains=[now_time.isoweekday()]
).exists()
school_schedules_purchased = schoolpayment_queryset.annotate(
joined_weekdays=Func(F('weekdays'), function='unnest',)
).values_list('joined_weekdays', flat=True).distinct()

Loading…
Cancel
Save