diff --git a/doc/upgrade.rst b/doc/upgrade.rst index b05ec6d63..e7345e561 100644 --- a/doc/upgrade.rst +++ b/doc/upgrade.rst @@ -91,8 +91,8 @@ Rebuild Virtual Environment Specific instructions ********************* -2.0.0-beta.1 -============ +2.0.0 +===== Add ``drf_spectacular`` and ``phonenumber_field`` to ``INSTALLED_APPS`` in the :file:`settings.py` file, as follows: @@ -145,6 +145,8 @@ Add the new following settings: PHONENUMBER_DB_FORMAT = 'INTERNATIONAL' + DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' + New admin interface ------------------- diff --git a/modoboa/core/api/v2/views.py b/modoboa/core/api/v2/views.py index ae791d1dc..214affd20 100644 --- a/modoboa/core/api/v2/views.py +++ b/modoboa/core/api/v2/views.py @@ -2,6 +2,7 @@ import logging +from django.utils.html import escape from django.utils.translation import ugettext as _ from rest_framework import response, status @@ -25,7 +26,7 @@ class TokenObtainPairView(jwt_views.TokenObtainPairView): logger.warning( _("Failed connection attempt from '%s' as user '%s'"), request.META["REMOTE_ADDR"], - serializer.data["username"] + escape(serializer.data["username"]) ) raise InvalidToken(e.args[0]) diff --git a/modoboa/core/commands/templates/settings.py.tpl b/modoboa/core/commands/templates/settings.py.tpl index 11f13ab16..bdb79434c 100644 --- a/modoboa/core/commands/templates/settings.py.tpl +++ b/modoboa/core/commands/templates/settings.py.tpl @@ -172,6 +172,11 @@ USE_L10N = True USE_TZ = True +# Default primary key field type +# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' + # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/2.2/howto/static-files/ diff --git a/modoboa/core/templates/core/api_access.html b/modoboa/core/templates/core/api_access.html index 6215d0ca2..5e946e27a 100644 --- a/modoboa/core/templates/core/api_access.html +++ b/modoboa/core/templates/core/api_access.html @@ -3,7 +3,7 @@

{% trans "API access" %} {% trans "Control your access to Modoboa API" %}


- {% url "docs-index" as api_doc_url %} + {% url "docs-index-v2" as api_doc_url %} {% blocktrans with url=api_doc_url trimmed %} A documentation of the API is available here. {% endblocktrans %}