Commit 6d0c72c2 authored by Daniel W Bond's avatar Daniel W Bond
Browse files

improved filter to retrieve lookouts

parent 60a11fd0
......@@ -55,12 +55,12 @@ class DetailStudent(LoginRequiredMixin, DetailView):
#context['listings'] = Listing.objects.filter(seller='2')
context['listings'] = student_listings
context['me'] = self.get_object().pk
context['lookouts'] = Lookout.objects.filter(owner=self.get_object().user)
context['lookouts'] = Lookout.objects.filter(owner=self.get_object())
context['proceeds'] = total_proceeds(student_listings)
context['sales'] = total_sales(student_listings)
context['bids'] = Bid.objects.filter(bidder=self.get_object().user)
context['bids'] = Bid.objects.filter(bidder=self.get_object())
return context
......
......@@ -8,5 +8,5 @@ class HomepageView(TemplateView):
def get_context_data(self, **kwargs):
context = super(HomepageView, self).get_context_data(**kwargs)
if self.request.user.is_authenticated():
context['lookouts'] = Lookout.objects.filter(owner=self.request.user)
context['lookouts'] = Lookout.objects.filter(owner=self.request.user.student)
return context
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