Fix school current day in profile

remotes/origin/hasaccess
Ivlev Denis 8 years ago
parent a7ad7800fe
commit d047409fce
  1. 5
      apps/user/views.py

@ -85,7 +85,10 @@ class UserView(DetailView):
context['subscription_ends'] = school_payment.last().date_end
context['school_schedules'] = SchoolSchedule.objects.filter(
weekday__in=school_schedules_purchased if school_payment.exists() else [],
)
).annotate(
calk=F('weekday') - now().isoweekday(),
weight=(7 + F('calk') % 7) % 7,
).order_by('weight')
return context

Loading…
Cancel
Save