Date_end fixed

remotes/origin/hotfix/LIL-691
nikita 7 years ago
parent 769930e785
commit e08afe24f0
  1. 5
      apps/school/views.py

@ -143,7 +143,6 @@ class SchoolView(TemplateView):
Pingback.PINGBACK_TYPE_GOODWILL, Pingback.PINGBACK_TYPE_GOODWILL,
Pingback.PINGBACK_TYPE_RISK_REVIEWED_ACCEPTED, Pingback.PINGBACK_TYPE_RISK_REVIEWED_ACCEPTED,
], ],
date_start__lte=date_now,
date_end__gte=date_now date_end__gte=date_now
) )
school_payment_exists = school_payment.exists() school_payment_exists = school_payment.exists()
@ -180,7 +179,7 @@ class SchoolView(TemplateView):
ll.school_schedule = school_schedules_dict.get(ll.date.isoweekday()) ll.school_schedule = school_schedules_dict.get(ll.date.isoweekday())
live_lessons_exists = live_lessons.exists() live_lessons_exists = live_lessons.exists()
live_lessons = live_lessons or None live_lessons = live_lessons or None
subscription_ends = school_payment.filter(add_days=False).last().date_end if school_payment_exists else None subscription_ends = school_payment.filter(add_days=False).latest('date_end').date_end if school_payment_exists else None
context.update({ context.update({
'online': online, 'online': online,
'live_lessons': live_lessons, 'live_lessons': live_lessons,
@ -196,7 +195,7 @@ class SchoolView(TemplateView):
'school_purchased_future': False, 'school_purchased_future': False,
'subscription_ends': subscription_ends, 'subscription_ends': subscription_ends,
'prolong_date_start': subscription_ends + timedelta(days=1) if subscription_ends else None, 'prolong_date_start': subscription_ends + timedelta(days=1) if subscription_ends else None,
'allow_prolong': subscription_ends - date_now <= timedelta(days=14) if subscription_ends else False, 'allow_prolong': subscription_ends - date_now <= timedelta(days=7) if subscription_ends else False,
}) })
return context return context

Loading…
Cancel
Save