From b9630092d51cef4ee79863620d61e31513de4642 Mon Sep 17 00:00:00 2001 From: Nathan Chapman Date: Mon, 8 Feb 2021 16:26:32 -0700 Subject: [PATCH] Remove order by in favor of ordering in the model --- attendance/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/attendance/views.py b/attendance/views.py index 470ced2..5f1f675 100644 --- a/attendance/views.py +++ b/attendance/views.py @@ -26,6 +26,9 @@ from .forms import AttendanceUpdateForm, PeriodForm class AttendanceOverview(LoginRequiredMixin, TemplateView): template_name = 'attendance/attendance_overview.html' + def get_queryset(self): + + def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context['user'] = self.request.user @@ -61,7 +64,7 @@ class AttendanceOverview(LoginRequiredMixin, TemplateView): clocked_in__year=timezone.now().year ).filter( clocked_in__month=timezone.now().month - ).order_by('-clocked_in') + ) if student.current_period_id != None: context['current_period'] = Period.objects.get(pk=student.current_period_id) return context