|
|
|
|
@ -75,7 +75,12 @@ class SchoolView(TemplateView): |
|
|
|
|
|
|
|
|
|
def get_context_data(self): |
|
|
|
|
context = super().get_context_data() |
|
|
|
|
date_now = now().date() |
|
|
|
|
school_payment = SchoolPayment.objects.filter(date_start__lte=date_now, date_end__gte=date_now) |
|
|
|
|
school_payment_exists = school_payment.exists() |
|
|
|
|
context.update({ |
|
|
|
|
'subscription_ends': school_payment.first().date_end if school_payment_exists else None, |
|
|
|
|
'is_purchased': school_payment_exists, |
|
|
|
|
'school_schedules': SchoolSchedule.objects.all(), |
|
|
|
|
'min_school_price': SchoolSchedule.objects.aggregate(Min('month_price'))['month_price__min'], |
|
|
|
|
}) |
|
|
|
|
|