Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
SchrodingersGat committed Nov 25, 2024
1 parent 1ce3e01 commit fcc5f0e
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/backend/InvenTree/report/templatetags/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,7 @@ def filter_queryset(queryset, **kwargs) -> list:
Example:
{% filter_queryset companies is_supplier=True as suppliers %}
"""
results = queryset.filter(**kwargs)

# Return the filtered queryset, which can be assigned to a new variable
# Note that we return a list, not a queryset, to ensure that the results are evaluated before being passed to the template
# This prevents a malicious user from using the queryset in nefarious ways
return list(results)
return queryset.filter(**kwargs)


@register.simple_tag()
Expand Down

0 comments on commit fcc5f0e

Please sign in to comment.