|
|
|
|
@ -143,7 +143,6 @@ class SchoolView(TemplateView): |
|
|
|
|
Pingback.PINGBACK_TYPE_GOODWILL, |
|
|
|
|
Pingback.PINGBACK_TYPE_RISK_REVIEWED_ACCEPTED, |
|
|
|
|
], |
|
|
|
|
date_start__lte=date_now, |
|
|
|
|
date_end__gte=date_now |
|
|
|
|
) |
|
|
|
|
school_payment_exists = school_payment.exists() |
|
|
|
|
@ -180,7 +179,7 @@ class SchoolView(TemplateView): |
|
|
|
|
ll.school_schedule = school_schedules_dict.get(ll.date.isoweekday()) |
|
|
|
|
live_lessons_exists = live_lessons.exists() |
|
|
|
|
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({ |
|
|
|
|
'online': online, |
|
|
|
|
'live_lessons': live_lessons, |
|
|
|
|
@ -196,7 +195,7 @@ class SchoolView(TemplateView): |
|
|
|
|
'school_purchased_future': False, |
|
|
|
|
'subscription_ends': subscription_ends, |
|
|
|
|
'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 |
|
|
|
|
|
|
|
|
|
|