Commit 901ebe9f authored by okhin's avatar okhin 🚴

Fixing the related qttributes of category prefetch

parent 813f4d25
Pipeline #1303 passed with stages
in 6 minutes and 59 seconds
...@@ -16,10 +16,10 @@ class FeedbackFilterByCategory(admin.SimpleListFilter): ...@@ -16,10 +16,10 @@ class FeedbackFilterByCategory(admin.SimpleListFilter):
'category__name') 'category__name')
else: else:
user_orgs = [x.id for x in request.user.organizations.all()] user_orgs = [x.id for x in request.user.organizations.all()]
feedbacks = Feedback.objects.filter( feedbacks = Feedback.objects.select_related('category').filter(
category__organization__in=user_orgs).values_list( category__organization__in=user_orgs).values_list(
'category_id', 'category__id',
'category_name') 'category__name')
return ((f[0], f[1],) for f in sorted(set(feedbacks), key=lambda f: f[1])) return ((f[0], f[1],) for f in sorted(set(feedbacks), key=lambda f: f[1]))
......
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