From 939fd4f0c09fbc185f058036375091281cc89273 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Vinot?= Date: Mon, 5 Feb 2024 13:48:33 +0100 Subject: [PATCH 1/3] Delete a warning with Python 3.12 --- grappelli/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grappelli/settings.py b/grappelli/settings.py index b8a07b310..6a1fb95ce 100644 --- a/grappelli/settings.py +++ b/grappelli/settings.py @@ -24,7 +24,7 @@ # SWITCH_USER_ORIGINAL: Defines if a user is a valid target. # Gets a user object and returns True/False. SWITCH_USER_TARGET = getattr(settings, "GRAPPELLI_SWITCH_USER_TARGET", lambda original_user, user: user.is_staff and not user.is_superuser) -SWITCH_USER_REGEX = getattr(settings, "GRAPPELLI_SWITCH_USER_REGEX", "\d+") +SWITCH_USER_REGEX = getattr(settings, "GRAPPELLI_SWITCH_USER_REGEX", r"\d+") # CLEAN INPUT TYPES # Replaces input types: search, email, url, tel, number, range, date From 2b91886eff6d9fbbe0e7597b5264a5d160513c3e Mon Sep 17 00:00:00 2001 From: Slava Date: Thu, 22 Feb 2024 16:58:52 +0200 Subject: [PATCH 2/3] Fix translation not working in delete_confirmation.html Fix the translation strings used for the button. Otherwise, the translation won't work. --- grappelli/templates/admin/delete_confirmation.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grappelli/templates/admin/delete_confirmation.html b/grappelli/templates/admin/delete_confirmation.html index 06a7f4675..cdbdc3e2c 100644 --- a/grappelli/templates/admin/delete_confirmation.html +++ b/grappelli/templates/admin/delete_confirmation.html @@ -52,8 +52,8 @@

{% blocktrans with escaped_object=object %}Are you sure you want to delete t