From 10b82afc0f407260e421f2bf76571dd139755289 Mon Sep 17 00:00:00 2001 From: gzbender Date: Sat, 1 Jun 2019 14:24:35 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BD=D0=B5=20=D0=BF=D0=BE=D0=BA=D0=B0=D0=B7?= =?UTF-8?q?=D1=8B=D0=B2=D0=B0=D0=B5=D1=82=20=D0=BF=D1=80=D0=BE=D1=88=D0=BB?= =?UTF-8?q?=D1=8B=D0=B5=20=D1=83=D1=80=D0=BE=D0=BA=D0=B8=20=D0=BF=D0=BE=20?= =?UTF-8?q?=D0=BE=D0=BA=D0=BE=D0=BD=D1=87=D0=B0=D0=BD=D0=B8=D1=8E=20=D1=88?= =?UTF-8?q?=D0=BA=D0=BE=D0=BB=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/school/views.py | 2 +- apps/user/views.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/school/views.py b/apps/school/views.py index 212d3c84..0bbe959b 100644 --- a/apps/school/views.py +++ b/apps/school/views.py @@ -289,7 +289,7 @@ class DrawingCampView(TemplateView): next_schedule = school_schedule next_lesson_start = next_schedule.start_at_humanize if not next_schedule: - next_camp_lesson = LiveLesson.objects.filter(date__gt=date_now, is_camp=True).first() + next_camp_lesson = LiveLesson.objects.filter(date__gt=date_now, is_camp=True).order_by('date').first() if next_camp_lesson and next_camp_lesson.school_schedule: next_schedule = next_camp_lesson.school_schedule next_lesson_start = arrow.get(datetime.combine(next_camp_lesson.date, next_schedule.start_at), diff --git a/apps/user/views.py b/apps/user/views.py index 8a80e4cd..3399cf95 100644 --- a/apps/user/views.py +++ b/apps/user/views.py @@ -73,7 +73,7 @@ class ProfileView(TemplateView): ).distinct() school_payment = SchoolPayment.objects.filter( user=self.object, - date_end__gte=now(), + date_end__gte=now() - timedelta(7), status__in=[ Pingback.PINGBACK_TYPE_REGULAR, Pingback.PINGBACK_TYPE_GOODWILL, @@ -93,7 +93,7 @@ class ProfileView(TemplateView): camp_payment = DrawingCampPayment.objects.filter( user=self.object, - date_end__gte=now(), + date_end__gte=now() - timedelta(7), status__in=DrawingCampPayment.PW_PAID_STATUSES, ) context['is_camp_purchased'] = camp_payment.exists()