diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-03-26 15:26:20 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-07-21 15:07:41 +0200 |
commit | 62b34d0afb55a5c5c7bc1da22f0c0d293ee3936d (patch) | |
tree | d4bbb36fbd4f23f3fe406cefcc3be0ba396d981e /ishtar_common | |
parent | 18556dec8d2989f715d2251342aa4368fda857c8 (diff) | |
download | Ishtar-62b34d0afb55a5c5c7bc1da22f0c0d293ee3936d.tar.bz2 Ishtar-62b34d0afb55a5c5c7bc1da22f0c0d293ee3936d.zip |
♻️ django 3.2 deprecation: force_text -> force_str - templates: remove ifequal ; PIL: Image.ANTIALIAS -> Image.Resampling.LANCZOS
Diffstat (limited to 'ishtar_common')
-rw-r--r-- | ishtar_common/models.py | 2 | ||||
-rw-r--r-- | ishtar_common/templates/blocks/bs_formset_snippet.html | 4 | ||||
-rw-r--r-- | ishtar_common/templates/blocks/comma_list.html | 2 | ||||
-rw-r--r-- | ishtar_common/templates/ishtar/blocks/shortcut_menu.html | 2 | ||||
-rw-r--r-- | ishtar_common/widgets.py | 8 |
5 files changed, 9 insertions, 9 deletions
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 @@ <div class="col-sm-6"> <select class='{{main_cls}} chosen-select' id='current_{{model_name}}'> <option class='normal' value=''>--</option> - {% for val, label, selected, cls in items %}<option{% if cls %} class='{{cls}}'{% endif %} value='{{val}}'{% if selected %} selected="selected"{% endif %}>{% ifequal cls 'basket' %} {% endifequal %}{% ifequal cls 'green' %} {% endifequal %}{% ifequal cls 'orange' %} {% endifequal %}{% ifequal cls 'red' %} {% endifequal %}{{label}}</option> + {% for val, label, selected, cls in items %}<option{% if cls %} class='{{cls}}'{% endif %} value='{{val}}'{% if selected %} selected="selected"{% endif %}>{% if cls == 'basket' %} {% endif %}{% if cls == 'green' %} {% endif %}{% if cls == 'orange' %} {% endif %}{% if cls == 'red' %} {% endif %}{{label}}</option> {% endfor %}</select> </div> {% 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: |