Commit 961f5ed0b84208780144ff5a2d5060309bd09d65

Authored by Zambom
1 parent f13b4c0b

Adjusting subjects home presentation order

Showing 1 changed file with 2 additions and 2 deletions   Show diff stats
subjects/views.py
... ... @@ -39,9 +39,9 @@ class HomeView(LoginRequiredMixin, ListView):
39 39  
40 40 def get_queryset(self):
41 41 if self.request.user.is_staff:
42   - subjects = Subject.objects.all()
  42 + subjects = Subject.objects.all().order_by("name")
43 43 else:
44   - subjects = Subject.objects.all()
  44 + subjects = Subject.objects.all().order_by("name")
45 45 subjects = [subject for subject in subjects if self.request.user in subject.students.all() or self.request.user in subject.professor.all() or self.request.user in subject.category.coordinators.all()]
46 46  
47 47 print(subjects)
... ...