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()