Querysets are confusing

This commit is contained in:
Kumi 2021-04-09 17:02:45 +02:00
parent 85dbe78904
commit 17b9ca72c0

View file

@ -86,7 +86,7 @@ class OffersListView(LoginRequiredMixin, ListView):
template_name = "partners/offer_list.html" template_name = "partners/offer_list.html"
def get_queryset(self): def get_queryset(self):
return Offer.objects.filter(establishment__in=self.request.user.partnerprofile.establishment_set) return Offer.objects.filter(establishment__in=self.request.user.partnerprofile.establishment_set.all())
class EstablishmentsListView(LoginRequiredMixin, ListView): class EstablishmentsListView(LoginRequiredMixin, ListView):
model = Establishment model = Establishment