Fix schedules order

remotes/origin/hasaccess
Ivlev Denis 8 years ago
parent 8606806551
commit bdda452a04
  1. 4
      apps/school/views.py

@ -96,8 +96,8 @@ class SchoolView(TemplateView):
'is_purchased': school_payment_exists,
'min_school_price': SchoolSchedule.objects.aggregate(Min('month_price'))['month_price__min'],
'school_schedules': SchoolSchedule.objects.annotate(
width=date_now.weekday()-F('weekday') % 7,
).order_by('-width'),
width=(F('weekday') - date_now.isoweekday()) % 7,
).order_by('width'),
'school_schedules_purchased': school_schedules_purchased,
'subscription_ends': school_payment.filter(add_days=False).first().date_end if school_payment_exists else None,
})

Loading…
Cancel
Save