Commit e6db72f8 authored by Daniel W Bond's avatar Daniel W Bond

filter problem from when I didn't know querysets as well

parent b77f3818
......@@ -147,9 +147,7 @@ class DetailStudent(LoginRequiredMixin, DetailView):
def get_context_data(self, **kwargs):
context = super(DetailStudent, self).get_context_data(**kwargs)
# requesting_student = Student.objects.get(user=self.request.user)
requesting_student_filter = Student.objects.filter(user=self.request.user)
requesting_student = requesting_student_filter[0]
requesting_student = Student.objects.get(user=self.request.user)
same_floor = on_the_same_floor(self.get_object(), requesting_student)
......
......@@ -51,9 +51,7 @@ class DetailFloor(LoginRequiredMixin, DetailView):
def get_context_data(self, **kwargs):
context = super(DetailFloor, self).get_context_data(**kwargs)
# requesting_student = Student.objects.get(user=self.request.user)
requesting_student_filter = Student.objects.filter(user=self.request.user)
requesting_student = requesting_student_filter[0]
requesting_student = Student.objects.get(user=self.request.user)
# if self.request.user is on the floor
def onFloor():
......@@ -93,9 +91,7 @@ class DetailRoom(LoginRequiredMixin, DetailView):
def get_context_data(self, **kwargs):
context = super(DetailRoom, self).get_context_data(**kwargs)
# requesting_student = Student.objects.get(user=self.request.user)
requesting_student_filter = Student.objects.filter(user=self.request.user)
requesting_student = requesting_student_filter[0]
requesting_student = Student.objects.get(user=self.request.user)
# if self.request.user is on the floor
def onFloor():
......
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