Fetch permissions before rendering templates.

This commit is contained in:
Víðir Valberg Guðmundsson 2024-02-10 10:50:05 +01:00
parent a098a0b032
commit f99c7ee698

View file

@ -120,4 +120,9 @@ def render(request, template_name, context=None):
if context is None:
context = {}
context = base_context(request) | context
# Make sure to fetch all permissions before rendering the template
# otherwise django-zen-queries will complain about database queries.
request.user.get_all_permissions()
return zen_queries_render(request, template_name, context)