From 49cc12f99dbe2bc69edd09db39692ad2135473af Mon Sep 17 00:00:00 2001 From: Kevin Morris Date: Fri, 20 Aug 2021 14:44:36 -0700 Subject: [PATCH] jinja2: rename filter 'urlencode' to 'quote_plus' urlencode does more than just a quote_plus. Using urlencode was not sensible, so this commit addresses that. Signed-off-by: Kevin Morris --- aurweb/templates.py | 2 +- aurweb/util.py | 3 +++ templates/partials/packages/actions.html | 6 +++--- templates/partials/tu/proposal/voters.html | 2 +- templates/partials/tu/proposals.html | 6 +++--- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/aurweb/templates.py b/aurweb/templates.py index 48391b4a..a648d5a1 100644 --- a/aurweb/templates.py +++ b/aurweb/templates.py @@ -31,7 +31,7 @@ _env.filters["tn"] = l10n.tn _env.filters["dt"] = util.timestamp_to_datetime _env.filters["as_timezone"] = util.as_timezone _env.filters["dedupe_qs"] = util.dedupe_qs -_env.filters["urlencode"] = quote_plus +_env.filters["quote_plus"] = quote_plus _env.filters["get_vote"] = util.get_vote _env.filters["number_format"] = util.number_format diff --git a/aurweb/util.py b/aurweb/util.py index 860bdd12..494a988d 100644 --- a/aurweb/util.py +++ b/aurweb/util.py @@ -1,4 +1,5 @@ import base64 +import logging import math import random import re @@ -18,6 +19,8 @@ from jinja2 import pass_context import aurweb.config +logger = logging.getLogger(__name__) + def make_random_string(length): return ''.join(random.choices(string.ascii_lowercase diff --git a/templates/partials/packages/actions.html b/templates/partials/packages/actions.html index 346537be..d552f2dd 100644 --- a/templates/partials/packages/actions.html +++ b/templates/partials/packages/actions.html @@ -42,12 +42,12 @@ {% endif %}
  • - + {{ "Vote for this package" | tr }}
  • - + {{ "Enable notifications" | tr }}
  • @@ -133,7 +133,7 @@ {% endif %}
  • {% if not request.user.is_authenticated() %} - + {{ "Submit Request" | tr }} {% else %} diff --git a/templates/partials/tu/proposal/voters.html b/templates/partials/tu/proposal/voters.html index 2fd42bdf..6069f97d 100644 --- a/templates/partials/tu/proposal/voters.html +++ b/templates/partials/tu/proposal/voters.html @@ -2,7 +2,7 @@