Compare commits

..

No commits in common. "c0f7e9d50d772f83e184f465e25e33fd553574c3" and "ce024d57fdf8b67489ed75d79f25b47a181a9389" have entirely different histories.

29 changed files with 116 additions and 156 deletions

View file

@ -1,10 +1,5 @@
# Changelog
## 2.9.1 - 2025-03-03
* be more persuasive in deprecating twitter login backend by @yohanboniface in #2538
## 2.9.0 - 2025-03-03
This release is mainly about making the sync feature deployable and more stable (but still

View file

@ -28,13 +28,13 @@ Can be set through env var too: `ALLOWED_HOSTS=umap.mydomain.org,u.mydomain.org`
Set it to `True` for easier debugging in case of error.
#### DEPRECATED_AUTHENTICATION_BACKENDS
#### DEPRECATED_AUTHENTICATION_PROVIDERS
List of auth backends to deprecate. Defining this will display a message to
List of auth providers to deprecate. Defining this will display a message to
all users using this provider, to encourage them to configure another provider to
their account.
DEPRECATED_AUTHENTICATION_BACKENDS = ["social_core.backends.twitter_oauth2.TwitterOAuth2"]
DEPRECATED_AUTHENTICATION_PROVIDERS = ["social_core.backends.twitter_oauth2.TwitterOAuth2"]
#### EMAIL_BACKEND

View file

@ -44,14 +44,14 @@ dependencies = [
[project.optional-dependencies]
dev = [
"hatch==1.14.0",
"ruff==0.9.9",
"ruff==0.9.6",
"djlint==1.36.4",
"mkdocs==1.6.1",
"mkdocs-material==9.6.4",
"mkdocs-static-i18n==1.3.0",
"vermin==1.6.0",
"pymdown-extensions==10.14.3",
"isort==6.0.1",
"isort==6.0.0",
]
test = [
"daphne==4.1.2",

View file

@ -1 +1 @@
VERSION = "2.9.1"
VERSION = "2.9.0"

View file

@ -16,7 +16,7 @@ msgid ""
msgstr ""
"Project-Id-Version: uMap\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-03-03 17:36+0000\n"
"POT-Creation-Date: 2025-03-03 14:11+0000\n"
"PO-Revision-Date: 2013-11-22 14:00+0000\n"
"Last-Translator: Jiří Podhorecký <jirka.p@volny.cz>, 2018-2019,2023-2025\n"
"Language-Team: Czech (Czech Republic) (http://app.transifex.com/openstreetmap/umap/language/cs_CZ/)\n"
@ -34,18 +34,10 @@ msgstr "CSV Export"
msgid "This map is not publicly available"
msgstr "Tato mapa není veřejně dostupná"
#: middleware.py:19
#: middleware.py:13
msgid "Site is readonly for maintenance"
msgstr "Stránka je jen ke čtení kvůli údržbě"
#: middleware.py:34
#, python-format
msgid ""
"Using “%(name)s” to authenticate is deprecated and will be removed soon. "
"Please configure another provider below before losing access to your account"
" and maps."
msgstr ""
#: models.py:60 models.py:79
msgid "name"
msgstr "název"
@ -742,3 +734,10 @@ msgstr "Vrstva úspěšně vymazána."
#: views.py:1351
msgid "Permissions updated with success!"
msgstr "Oprávnění úspěšně aktualizována!"
#: views.py:1430
#, python-format
msgid ""
"Using “%(name)s” to authenticate is deprecated. Please configure another "
"provider in your profile page."
msgstr "Použití \"%(name)s\" k ověření je zastaralé. Nakonfigurujte prosím jiného poskytovatele na stránce svého profilu."

Binary file not shown.

View file

@ -13,7 +13,7 @@ msgid ""
msgstr ""
"Project-Id-Version: uMap\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-03-03 17:36+0000\n"
"POT-Creation-Date: 2025-01-31 17:29+0000\n"
"PO-Revision-Date: 2013-11-22 14:00+0000\n"
"Last-Translator: prendi <prendi@openmailbox.org>, 2017\n"
"Language-Team: Greek (http://app.transifex.com/openstreetmap/umap/language/el/)\n"
@ -31,18 +31,10 @@ msgstr "Εξαγωγή CSV"
msgid "This map is not publicly available"
msgstr "Αυτός ο χάρτης δεν είναι δημοσίως διαθέσιμος"
#: middleware.py:19
#: middleware.py:13
msgid "Site is readonly for maintenance"
msgstr "Λόγω συντήρησης, ο ιστότοπος είναι μόνο για ανάγνωση"
#: middleware.py:34
#, python-format
msgid ""
"Using “%(name)s” to authenticate is deprecated and will be removed soon. "
"Please configure another provider below before losing access to your account"
" and maps."
msgstr ""
#: models.py:60 models.py:79
msgid "name"
msgstr "όνομα"
@ -606,7 +598,7 @@ msgstr "Χάρτες που δημιουργήθηκαν τελευταίοι"
msgid "Search maps"
msgstr "Αναζήτηση χαρτών"
#: templates/umap/search_bar.html:16
#: templates/umap/search_bar.html:15
msgid "Search"
msgstr "Αναζήτηση"
@ -737,3 +729,10 @@ msgstr "Το επίπεδο διαγράφηκε με επιτυχία."
#: views.py:1351
msgid "Permissions updated with success!"
msgstr "Τα δικαιώματα ενημερώθηκαν με επιτυχία!"
#: views.py:1430
#, python-format
msgid ""
"Using “%(name)s” to authenticate is deprecated. Please configure another "
"provider in your profile page."
msgstr "Η χρήση του «%(name)s» για τον έλεγχο ταυτότητας έχει ξεπεραστεί. Παρακαλούμε ρυθμίστε έναν άλλο πάροχο στη σελίδα του προφίλ σας."

View file

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-03-03 17:36+0000\n"
"POT-Creation-Date: 2025-03-03 14:11+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -25,18 +25,10 @@ msgstr ""
msgid "This map is not publicly available"
msgstr ""
#: middleware.py:19
#: middleware.py:13
msgid "Site is readonly for maintenance"
msgstr ""
#: middleware.py:34
#, python-format
msgid ""
"Using “%(name)s” to authenticate is deprecated and will be removed soon. "
"Please configure another provider below before losing access to your account "
"and maps."
msgstr ""
#: models.py:60 models.py:79
msgid "name"
msgstr ""
@ -730,3 +722,10 @@ msgstr ""
#: views.py:1351
msgid "Permissions updated with success!"
msgstr ""
#: views.py:1430
#, python-format
msgid ""
"Using “%(name)s” to authenticate is deprecated. Please configure another "
"provider in your profile page."
msgstr ""

Binary file not shown.

View file

@ -17,7 +17,7 @@ msgid ""
msgstr ""
"Project-Id-Version: uMap\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-03-03 17:36+0000\n"
"POT-Creation-Date: 2025-01-31 17:29+0000\n"
"PO-Revision-Date: 2013-11-22 14:00+0000\n"
"Last-Translator: Ignacio L'Episcopo, 2024-2025\n"
"Language-Team: Spanish (http://app.transifex.com/openstreetmap/umap/language/es/)\n"
@ -35,18 +35,10 @@ msgstr "Exportar CSV"
msgid "This map is not publicly available"
msgstr "Este mapa no está disponible públicamente"
#: middleware.py:19
#: middleware.py:13
msgid "Site is readonly for maintenance"
msgstr "Sitio en modo solo lectura por mantenimiento"
#: middleware.py:34
#, python-format
msgid ""
"Using “%(name)s” to authenticate is deprecated and will be removed soon. "
"Please configure another provider below before losing access to your account"
" and maps."
msgstr ""
#: models.py:60 models.py:79
msgid "name"
msgstr "nombre"
@ -611,7 +603,7 @@ msgstr "Últimos mapas creados"
msgid "Search maps"
msgstr "Buscar mapas"
#: templates/umap/search_bar.html:16
#: templates/umap/search_bar.html:15
msgid "Search"
msgstr "Buscar"
@ -742,3 +734,10 @@ msgstr "Se eliminó la capa con éxito."
#: views.py:1351
msgid "Permissions updated with success!"
msgstr "¡Permisos actualizados con éxito!"
#: views.py:1430
#, python-format
msgid ""
"Using “%(name)s” to authenticate is deprecated. Please configure another "
"provider in your profile page."
msgstr "Usar “%(name)s” para autenticar está obsoleto. Configura otro proveedor en la página de tu perfil."

Binary file not shown.

View file

@ -24,7 +24,7 @@ msgid ""
msgstr ""
"Project-Id-Version: uMap\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-03-03 17:36+0000\n"
"POT-Creation-Date: 2025-01-31 17:29+0000\n"
"PO-Revision-Date: 2013-11-22 14:00+0000\n"
"Last-Translator: yohanboniface <yohanboniface@free.fr>, 2013-2014,2018-2019,2023-2025\n"
"Language-Team: French (http://app.transifex.com/openstreetmap/umap/language/fr/)\n"
@ -42,18 +42,10 @@ msgstr "Export CSV"
msgid "This map is not publicly available"
msgstr "Cette carte n'est pas publique"
#: middleware.py:19
#: middleware.py:13
msgid "Site is readonly for maintenance"
msgstr "Le site est en lecture seule pour maintenance."
#: middleware.py:34
#, python-format
msgid ""
"Using “%(name)s” to authenticate is deprecated and will be removed soon. "
"Please configure another provider below before losing access to your account"
" and maps."
msgstr "Lutilisation de “%(name)s” pour sauthentifier est dépréciée et sera bientôt rendue impossible. Veuillez configurer un nouveau fournisseur ci-dessous avant de perdre laccès à votre compte et à vos cartes."
#: models.py:60 models.py:79
msgid "name"
msgstr "nom"
@ -618,7 +610,7 @@ msgstr "Dernières cartes créées."
msgid "Search maps"
msgstr "Chercher des cartes"
#: templates/umap/search_bar.html:16
#: templates/umap/search_bar.html:15
msgid "Search"
msgstr "Chercher"
@ -749,3 +741,10 @@ msgstr "Calque supprimé."
#: views.py:1351
msgid "Permissions updated with success!"
msgstr "Les permissions ont bien été modifiées !"
#: views.py:1430
#, python-format
msgid ""
"Using “%(name)s” to authenticate is deprecated. Please configure another "
"provider in your profile page."
msgstr "L'utilisation de “%(name)s” pour s'authentifier est déprécié. Veuillez configurer un nouveau fournisseur sur votre page profil."

Binary file not shown.

View file

@ -13,7 +13,7 @@ msgid ""
msgstr ""
"Project-Id-Version: uMap\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-03-03 17:36+0000\n"
"POT-Creation-Date: 2025-01-31 17:29+0000\n"
"PO-Revision-Date: 2013-11-22 14:00+0000\n"
"Last-Translator: Miguel Anxo Bouzada <mbouzada@gmail.com>, 2025\n"
"Language-Team: Galician (http://app.transifex.com/openstreetmap/umap/language/gl/)\n"
@ -31,18 +31,10 @@ msgstr "Exportar CSV"
msgid "This map is not publicly available"
msgstr "Este mapa non está dispoñíbel publicamente"
#: middleware.py:19
#: middleware.py:13
msgid "Site is readonly for maintenance"
msgstr "O sitio é só de lectura por mantemento"
#: middleware.py:34
#, python-format
msgid ""
"Using “%(name)s” to authenticate is deprecated and will be removed soon. "
"Please configure another provider below before losing access to your account"
" and maps."
msgstr ""
#: models.py:60 models.py:79
msgid "name"
msgstr "nome"
@ -606,7 +598,7 @@ msgstr "Últimos mapas creados"
msgid "Search maps"
msgstr "Buscar mapas"
#: templates/umap/search_bar.html:16
#: templates/umap/search_bar.html:15
msgid "Search"
msgstr "Buscar"
@ -737,3 +729,10 @@ msgstr "A capa foi eliminada correctamente."
#: views.py:1351
msgid "Permissions updated with success!"
msgstr "Os permisos foron actualizados correctamente!"
#: views.py:1430
#, python-format
msgid ""
"Using “%(name)s” to authenticate is deprecated. Please configure another "
"provider in your profile page."
msgstr "Usar «%(name)s» para autenticarse está obsoleto. Configura outro provedor na túa páxina de perfil."

Binary file not shown.

View file

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: uMap\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-03-03 17:36+0000\n"
"POT-Creation-Date: 2025-01-31 17:29+0000\n"
"PO-Revision-Date: 2013-11-22 14:00+0000\n"
"Last-Translator: Marco <marcxosm@gmail.com>, 2017-2019,2024-2025\n"
"Language-Team: Italian (http://app.transifex.com/openstreetmap/umap/language/it/)\n"
@ -39,18 +39,10 @@ msgstr "Esporta CSV"
msgid "This map is not publicly available"
msgstr "La mappa non è disponibile pubblicamente"
#: middleware.py:19
#: middleware.py:13
msgid "Site is readonly for maintenance"
msgstr "Il sito in sola lettura per manutenzione"
#: middleware.py:34
#, python-format
msgid ""
"Using “%(name)s” to authenticate is deprecated and will be removed soon. "
"Please configure another provider below before losing access to your account"
" and maps."
msgstr ""
#: models.py:60 models.py:79
msgid "name"
msgstr "nome"
@ -615,7 +607,7 @@ msgstr "Ultime mappe create"
msgid "Search maps"
msgstr "Cerca mappe"
#: templates/umap/search_bar.html:16
#: templates/umap/search_bar.html:15
msgid "Search"
msgstr "Cerca"
@ -746,3 +738,10 @@ msgstr "Layer eliminato correttamente"
#: views.py:1351
msgid "Permissions updated with success!"
msgstr "Autorizzazioni aggiornate con successo!"
#: views.py:1430
#, python-format
msgid ""
"Using “%(name)s” to authenticate is deprecated. Please configure another "
"provider in your profile page."
msgstr "Luso di “%(name)s” per autenticarsi è scoraggiato. Configura un altro fornitore nella pagina del tuo profilo."

Binary file not shown.

View file

@ -11,7 +11,7 @@ msgid ""
msgstr ""
"Project-Id-Version: uMap\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-03-03 17:36+0000\n"
"POT-Creation-Date: 2025-03-03 14:11+0000\n"
"PO-Revision-Date: 2013-11-22 14:00+0000\n"
"Last-Translator: Gideon van Melle <translations@gvmelle.com>, 2025\n"
"Language-Team: Dutch (http://app.transifex.com/openstreetmap/umap/language/nl/)\n"
@ -29,18 +29,10 @@ msgstr "CSV Export"
msgid "This map is not publicly available"
msgstr "Deze kaart is niet openbaar beschikbaar"
#: middleware.py:19
#: middleware.py:13
msgid "Site is readonly for maintenance"
msgstr "Site is 'alleen lezen' wegens onderhoud"
#: middleware.py:34
#, python-format
msgid ""
"Using “%(name)s” to authenticate is deprecated and will be removed soon. "
"Please configure another provider below before losing access to your account"
" and maps."
msgstr ""
#: models.py:60 models.py:79
msgid "name"
msgstr "naam"
@ -735,3 +727,10 @@ msgstr "Laag is verwijderd."
#: views.py:1351
msgid "Permissions updated with success!"
msgstr "Machtigingen met succes bijgewerkt!"
#: views.py:1430
#, python-format
msgid ""
"Using “%(name)s” to authenticate is deprecated. Please configure another "
"provider in your profile page."
msgstr "Het gebruik van “%(name)s” om te verifiëren is afgeschaft. Configureer een andere provider op je profielpagina."

Binary file not shown.

View file

@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: uMap\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-03-03 17:36+0000\n"
"POT-Creation-Date: 2025-01-31 17:29+0000\n"
"PO-Revision-Date: 2013-11-22 14:00+0000\n"
"Last-Translator: lecalam, 2024-2025\n"
"Language-Team: Portuguese (http://app.transifex.com/openstreetmap/umap/language/pt/)\n"
@ -28,18 +28,10 @@ msgstr "Exportação CSV"
msgid "This map is not publicly available"
msgstr "Este mapa não está disponível ao público"
#: middleware.py:19
#: middleware.py:13
msgid "Site is readonly for maintenance"
msgstr "O site está em modo de leitura para manutenção"
#: middleware.py:34
#, python-format
msgid ""
"Using “%(name)s” to authenticate is deprecated and will be removed soon. "
"Please configure another provider below before losing access to your account"
" and maps."
msgstr ""
#: models.py:60 models.py:79
msgid "name"
msgstr "nome"
@ -604,7 +596,7 @@ msgstr "Últimos mapas criados"
msgid "Search maps"
msgstr "Procurar mapas"
#: templates/umap/search_bar.html:16
#: templates/umap/search_bar.html:15
msgid "Search"
msgstr "Procurar"
@ -735,3 +727,10 @@ msgstr "Camada eliminada com sucesso."
#: views.py:1351
msgid "Permissions updated with success!"
msgstr "Permissões atualizadas com sucesso!"
#: views.py:1430
#, python-format
msgid ""
"Using “%(name)s” to authenticate is deprecated. Please configure another "
"provider in your profile page."
msgstr "A utilização de “%(name)s” para autenticação está desatualizada. Configure outro fornecedor na sua página de perfil."

View file

@ -15,7 +15,7 @@ msgid ""
msgstr ""
"Project-Id-Version: uMap\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-03-03 17:36+0000\n"
"POT-Creation-Date: 2025-01-31 17:29+0000\n"
"PO-Revision-Date: 2013-11-22 14:00+0000\n"
"Last-Translator: Supaplex <bejokeup@gmail.com>, 2019,2023-2025\n"
"Language-Team: Chinese (Taiwan) (http://app.transifex.com/openstreetmap/umap/language/zh_TW/)\n"
@ -33,18 +33,10 @@ msgstr "CSV 匯出"
msgid "This map is not publicly available"
msgstr "這份地圖並非公開可及的"
#: middleware.py:19
#: middleware.py:13
msgid "Site is readonly for maintenance"
msgstr "網站目前因維護中設定為唯讀狀態"
#: middleware.py:34
#, python-format
msgid ""
"Using “%(name)s” to authenticate is deprecated and will be removed soon. "
"Please configure another provider below before losing access to your account"
" and maps."
msgstr ""
#: models.py:60 models.py:79
msgid "name"
msgstr "名稱"
@ -607,7 +599,7 @@ msgstr "最新創建地圖"
msgid "Search maps"
msgstr "搜尋地圖"
#: templates/umap/search_bar.html:16
#: templates/umap/search_bar.html:15
msgid "Search"
msgstr "搜尋"
@ -738,3 +730,10 @@ msgstr "圖層已刪除"
#: views.py:1351
msgid "Permissions updated with success!"
msgstr "權限更新完成"
#: views.py:1430
#, python-format
msgid ""
"Using “%(name)s” to authenticate is deprecated. Please configure another "
"provider in your profile page."
msgstr "使用\"%(name)s\"來認證已經廢棄了,請在你的個人檔案頁面使用其他供應商來設定認證。"

View file

@ -1,12 +1,6 @@
from django.conf import settings
from django.contrib import messages
from django.contrib.auth import BACKEND_SESSION_KEY
from django.core.exceptions import MiddlewareNotUsed
from django.http import (
HttpResponseForbidden,
HttpResponseRedirect,
)
from django.urls import reverse
from django.http import HttpResponseForbidden
from django.utils.translation import gettext as _
@ -21,26 +15,3 @@ def readonly_middleware(get_response):
return get_response(request)
return middleware
def deprecated_auth_backend(get_response):
def middleware(request):
backend = request.session.get(BACKEND_SESSION_KEY)
if backend in settings.DEPRECATED_AUTHENTICATION_BACKENDS:
name = backend.split(".")[-1]
messages.error(
request,
_(
"Using “%(name)s” to authenticate is deprecated and will be "
"removed soon. "
"Please configure another provider below before losing access "
"to your account and maps."
)
% {"name": name},
)
if "/map/" in request.path:
return HttpResponseRedirect(reverse("user_profile"))
return get_response(request)
return middleware

View file

@ -235,7 +235,6 @@ MIDDLEWARE = (
"django.middleware.csrf.CsrfViewMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"umap.middleware.deprecated_auth_backend",
)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 545 B

View file

@ -29,9 +29,9 @@
<h3>
{% trans "Your current providers" %}
</h3>
<ul class="login-grid block-grid">
<ul>
{% for name in providers %}
<li>
<li class="login-grid">
{% with "umap/img/providers/"|add:name|add:".png" as path %}
<img src="{% static path %}" width="92px" height="92px" alt="{{ name }}" />
{% endwith %}

View file

@ -3,10 +3,6 @@
{% include "umap/components/alerts/alert.html" %}
{% for message in messages %}
<script type="module" defer>
{% if message.level == DEFAULT_MESSAGE_LEVELS.ERROR %}
U.Alert.error("{{ message }}")
{% else %}
U.Alert.success("{{ message }}")
{% endif %}
</script>
{% endfor %}

View file

@ -1423,5 +1423,14 @@ class LoginPopupEnd(TemplateView):
def get(self, *args, **kwargs):
backend = self.request.session[BACKEND_SESSION_KEY]
if backend in settings.DEPRECATED_AUTHENTICATION_BACKENDS:
name = backend.split(".")[-1]
messages.error(
self.request,
_(
"Using “%(name)s” to authenticate is deprecated. "
"Please configure another provider in your profile page."
)
% {"name": name},
)
return HttpResponseRedirect(reverse("user_profile"))
return super().get(*args, **kwargs)