Fix sort days

remotes/origin/hasaccess
Ivlev Denis 8 years ago
parent a584d2c671
commit 8d575727e0
  1. 5
      apps/school/views.py

@ -124,8 +124,9 @@ 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=(F('weekday') - date_now.isoweekday()) % 7,
).order_by('width'),
calk=F('weekday') - now().isoweekday(),
weight=(7 + F('calk') % 7) % 7,
).order_by('weight'),
'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