Commit 758d58e8 authored by Daniel W Bond's avatar Daniel W Bond
Browse files

finagled leftovers from merge

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