Commit b126fd14 authored by Daniel W Bond's avatar Daniel W Bond
Browse files

major sorting now filters through a list of majors instead of lookup with a single object

parent ef7ab00e
......@@ -278,7 +278,7 @@ class DetailMajor(LoginRequiredMixin, DetailView):
rooms = [
for room in Room.objects.filter(floor__building__neighbourhood=neighbourhood)
if room.student_set.filter(major=self.get_object())
if room.student_set.filter(major__in=[self.get_object()])
# identify if the student(s) in that room are visible to the requesting student
......@@ -294,7 +294,7 @@ class DetailMajor(LoginRequiredMixin, DetailView):
])), key=attrgetter('user.username'))
# see what students are left over (aren't visible)
hidden = set(Student.objects.filter(major=self.get_object()).order_by('user__username'))
hidden = set(Student.objects.filter(major__in=[self.get_object()]).order_by('user__username'))
# print(hidden)
for visible in visible_by_neighbourhood.values():
# print('visible', visible)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment