diff --git a/apps/user/templates/user/profile.html b/apps/user/templates/user/profile.html index 0dbd54b2..c1bb7f81 100644 --- a/apps/user/templates/user/profile.html +++ b/apps/user/templates/user/profile.html @@ -71,6 +71,7 @@ КУРСЫ {% endif %} +
@@ -89,6 +90,13 @@
{% endif %} +
+
+
+ {% include "course/school.html" %} +
+
+
diff --git a/apps/user/views.py b/apps/user/views.py index bf2a6ebd..4a082294 100644 --- a/apps/user/views.py +++ b/apps/user/views.py @@ -63,6 +63,23 @@ class UserView(DetailView): ], ), ).distinct() + school_payment = SchoolPayment.objects.filter( + user=self.object, + date_start__lte=now(), + date_end__gt=now(), + status__in=[ + Pingback.PINGBACK_TYPE_REGULAR, + Pingback.PINGBACK_TYPE_GOODWILL, + Pingback.PINGBACK_TYPE_RISK_REVIEWED_ACCEPTED, + ], + ).last() + context['school_payment'] = school_payment + if school_payment and school_payment.date_end: + context['school_days_left'] = (school_payment.date_end - now().date()).days + context['school_schedules'] = SchoolSchedule.objects.filter( + weekday__in=school_payment.weekdays if school_payment else [], + ) + return context