Use urlencode for querystring macro

This commit is contained in:
2026-03-28 14:32:08 +01:00
parent 2a9bb46e97
commit bb69c76a8b
2 changed files with 2 additions and 10 deletions

View File

@@ -254,14 +254,5 @@
{% macro querystring() %}
{%- for key, values in request.GET.lists() -%}
{%- if key not in kwargs -%}
{%- for value in values -%}
{{ key }}={{ value }}&
{%- endfor -%}
{%- endif -%}
{%- endfor -%}
{%- for key, value in kwargs.items() -%}
{{ key }}={{ value }}&
{%- endfor -%}
{{- urlencode(dict(dict(request.GET.lists()) | items | list + kwargs | items | list), doseq=True) -}}
{% endmacro %}

View File

@@ -190,6 +190,7 @@ TEMPLATES = [
"get_sith": "com.views.sith",
"get_language": "django.utils.translation.get_language",
"timedelta": "datetime.timedelta",
"urlencode": "urllib.parse.urlencode",
},
"bytecode_cache": {
"name": "default",