From 62b34d0afb55a5c5c7bc1da22f0c0d293ee3936d Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 26 Mar 2025 15:26:20 +0100 Subject: ♻️ django 3.2 deprecation: force_text -> force_str - templates: remove ifequal ; PIL: Image.ANTIALIAS -> Image.Resampling.LANCZOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ishtar_common/models.py | 2 +- ishtar_common/templates/blocks/bs_formset_snippet.html | 4 ++-- ishtar_common/templates/blocks/comma_list.html | 2 +- ishtar_common/templates/ishtar/blocks/shortcut_menu.html | 2 +- ishtar_common/widgets.py | 8 ++++---- 5 files changed, 9 insertions(+), 9 deletions(-) (limited to 'ishtar_common') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index e3f2b8b61..9a3eac46a 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -521,7 +521,7 @@ class ImageModel(models.Model, ImageContainerModel): def create_thumb(self, image, size): """Returns the image resized to fit inside a box of the given size""" - image.thumbnail(size, Image.ANTIALIAS) + image.thumbnail(size, Image.Resampling.LANCZOS) temp = BytesIO() image.save(temp, "jpeg") temp.seek(0) diff --git a/ishtar_common/templates/blocks/bs_formset_snippet.html b/ishtar_common/templates/blocks/bs_formset_snippet.html index cfc9bb37b..8ed958d1c 100644 --- a/ishtar_common/templates/blocks/bs_formset_snippet.html +++ b/ishtar_common/templates/blocks/bs_formset_snippet.html @@ -19,9 +19,9 @@ {% csrf_token %} {% for field in form.visible_fields %} - {% ifequal field.name "DELETE" %}{% with bs_col_width='col-2' %}{% include "blocks/bs_field_snippet.html" %}{% endwith %} + {% if field.name == "DELETE" %}{% with bs_col_width='col-2' %}{% include "blocks/bs_field_snippet.html" %}{% endwith %} {% else %}{% with bs_col_width='col-3' %}{% include "blocks/bs_field_snippet.html" %}{% endwith %} - {% endifequal %} + {% endif %} {% endfor %} {% if form.extra_render %} diff --git a/ishtar_common/templates/blocks/comma_list.html b/ishtar_common/templates/blocks/comma_list.html index 12fcd2b41..60aa6bacc 100644 --- a/ishtar_common/templates/blocks/comma_list.html +++ b/ishtar_common/templates/blocks/comma_list.html @@ -1 +1 @@ -{% load i18n %}{% if not forloop.last %}{% ifequal forloop.revcounter 2 %} {% trans "and" %} {% else %}{% trans ", "%}{% endifequal %}{% else %}{% trans "." %}{% endif %} +{% load i18n %}{% if not forloop.last %}{% if forloop.revcounter == 2 %} {% trans "and" %} {% else %}{% trans ", "%}{% endif %}{% else %}{% trans "." %}{% endif %} diff --git a/ishtar_common/templates/ishtar/blocks/shortcut_menu.html b/ishtar_common/templates/ishtar/blocks/shortcut_menu.html index 447deb573..1253aa12a 100644 --- a/ishtar_common/templates/ishtar/blocks/shortcut_menu.html +++ b/ishtar_common/templates/ishtar/blocks/shortcut_menu.html @@ -27,7 +27,7 @@
{% with 'show-'|add:model_name as model_url%} diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py index a7a59d818..b96baee01 100644 --- a/ishtar_common/widgets.py +++ b/ishtar_common/widgets.py @@ -33,7 +33,7 @@ from django.forms.widgets import ( from django.template import loader from django.template.defaultfilters import slugify from django.urls import reverse, NoReverseMatch -from django.utils.encoding import smart_text +from django.utils.encoding import smart_str from django.utils.functional import lazy from django.utils.html import escape from django.utils.safestring import mark_safe @@ -796,7 +796,7 @@ class JQueryAutoComplete(forms.TextInput): hiddens = [] selects = [] if type(value) not in (list, tuple): - values = str(escape(smart_text(value))) + values = str(escape(smart_str(value))) values = values.replace("[", "").replace("]", "") values = values.split(",") else: @@ -998,7 +998,7 @@ class JQueryTown(forms.TextInput): hiddens = [] selects = [] if type(value) not in (list, tuple): - values = str(escape(smart_text(value))) + values = str(escape(smart_str(value))) values = values.replace("[", "").replace("]", "") values = values.split(",") else: @@ -1124,7 +1124,7 @@ class JQueryPersonOrganization(forms.TextInput): hiddens = [] selects = [] if type(value) not in (list, tuple): - values = str(escape(smart_text(value))) + values = str(escape(smart_str(value))) values = values.replace("[", "").replace("]", "") values = values.split(",") else: -- cgit v1.2.3