Commit 86b0ed8e authored by Daniel W Bond's avatar Daniel W Bond
Browse files

changing the 'tostring' for student makes .exclude() silently break: fixed with different reference

parent a42b8e7f
......@@ -29,13 +29,13 @@ class LandingPage(LoginRequiredMixin, TemplateView):
context['me'] = me
# Create Dictionaries to store Students that meet criteria
roomies = Student.objects.filter(room=me.room).exclude(user__username=me)
floories = Student.objects.filter(room__floor=me.get_floor()).exclude(user__username=me).exclude(room=me.room).order_by('room')
roomies = Student.objects.filter(room=me.room).exclude(user=me.user)
floories = Student.objects.filter(room__floor=me.get_floor()).exclude(user=me.user).exclude(room=me.room).order_by('room')
my_majors = tuple(me.major.all())
students_by_major = {}
for major in my_majors:
students_by_major[major] = Student.objects.filter(major__in=[major]).exclude(user__username=me).order_by('?')[:8]
students_by_major[major] = Student.objects.filter(major__in=[major]).exclude(user=me.user).order_by('?')[:8]
majormates = students_by_major
context["roomies"] = shadowbanning(me, roomies)
......
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