chore: replace settings.FROM_EMAIL by settings.DEFAULT_FROM_EMAIL
DEFAULT_FROM_EMAIL is a Django standard setting
This commit is contained in:
parent
3f3392952c
commit
1db2455d51
6 changed files with 7 additions and 6 deletions
|
@ -19,6 +19,7 @@ More details below!
|
||||||
* remove `django-compressor`, so `umap compress` is not a valid command anymore (compress is now done in the `collectstatic` process itself) (#1544, #1539)
|
* remove `django-compressor`, so `umap compress` is not a valid command anymore (compress is now done in the `collectstatic` process itself) (#1544, #1539)
|
||||||
* remove support for settings starting with `LEAFLET_STORAGE_` (deprecated since 1.0.0)
|
* remove support for settings starting with `LEAFLET_STORAGE_` (deprecated since 1.0.0)
|
||||||
* remove support for deprecated OpenStreetMap OAuth1 backend in favour of OAuth2
|
* remove support for deprecated OpenStreetMap OAuth1 backend in favour of OAuth2
|
||||||
|
* `FROM_EMAIL` setting is replaced by `DEFAULT_FROM_EMAIL`, which is [Django standard](https://docs.djangoproject.com/en/5.0/ref/settings/#default-from-email)
|
||||||
|
|
||||||
#### Migrate to OpenStreetMap OAuth2
|
#### Migrate to OpenStreetMap OAuth2
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ documentation.
|
||||||
In general, you'll need to add something like this in your local settings:
|
In general, you'll need to add something like this in your local settings:
|
||||||
|
|
||||||
```python title="local_settings.py"
|
```python title="local_settings.py"
|
||||||
FROM_EMAIL = "youradmin@email.org"
|
DEFAULT_FROM_EMAIL = "youradmin@email.org"
|
||||||
EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
|
EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
|
||||||
EMAIL_HOST = "smtp.provider.org"
|
EMAIL_HOST = "smtp.provider.org"
|
||||||
EMAIL_PORT = 456
|
EMAIL_PORT = 456
|
||||||
|
@ -60,7 +60,7 @@ Can be set through env var: `ENABLE_ACCOUNT_LOGIN=1`
|
||||||
User accounts can be managed via the Django admin page (`{SITE_URL}/admin`).
|
User accounts can be managed via the Django admin page (`{SITE_URL}/admin`).
|
||||||
The required superuser must be created on the command line with this command: `umap createsuperuser`.
|
The required superuser must be created on the command line with this command: `umap createsuperuser`.
|
||||||
|
|
||||||
#### FROM_EMAIL
|
#### DEFAULT_FROM_EMAIL
|
||||||
|
|
||||||
See `EMAIL_BACKEND`.
|
See `EMAIL_BACKEND`.
|
||||||
|
|
||||||
|
|
|
@ -128,7 +128,7 @@ INSTALLED_APPS = (
|
||||||
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
|
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
|
||||||
|
|
||||||
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
|
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
|
||||||
FROM_EMAIL = None
|
DEFAULT_FROM_EMAIL = None
|
||||||
# https://docs.djangoproject.com/en/4.2/releases/4.1/#forms
|
# https://docs.djangoproject.com/en/4.2/releases/4.1/#forms
|
||||||
FORM_RENDERER = "django.forms.renderers.DjangoDivFormRenderer"
|
FORM_RENDERER = "django.forms.renderers.DjangoDivFormRenderer"
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ import os
|
||||||
from umap.settings.base import * # pylint: disable=W0614,W0401
|
from umap.settings.base import * # pylint: disable=W0614,W0401
|
||||||
|
|
||||||
SECRET_KEY = "justfortests"
|
SECRET_KEY = "justfortests"
|
||||||
FROM_EMAIL = "test@test.org"
|
DEFAULT_FROM_EMAIL = "test@test.org"
|
||||||
EMAIL_BACKEND = "django.core.mail.backends.locmem.EmailBackend"
|
EMAIL_BACKEND = "django.core.mail.backends.locmem.EmailBackend"
|
||||||
STORAGES["staticfiles"][
|
STORAGES["staticfiles"][
|
||||||
"BACKEND"
|
"BACKEND"
|
||||||
|
|
|
@ -156,7 +156,7 @@ map_urls = [
|
||||||
name="datalayer_permissions",
|
name="datalayer_permissions",
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
if settings.FROM_EMAIL:
|
if settings.DEFAULT_FROM_EMAIL:
|
||||||
map_urls.append(
|
map_urls.append(
|
||||||
re_path(
|
re_path(
|
||||||
r"^map/(?P<map_id>[\d]+)/send-edit-link/$",
|
r"^map/(?P<map_id>[\d]+)/send-edit-link/$",
|
||||||
|
|
|
@ -842,7 +842,7 @@ class SendEditLink(FormLessEditMixin, FormView):
|
||||||
% {"map_name": self.object.name}
|
% {"map_name": self.object.name}
|
||||||
),
|
),
|
||||||
_("Here is your secret edit link: %(link)s" % {"link": link}),
|
_("Here is your secret edit link: %(link)s" % {"link": link}),
|
||||||
settings.FROM_EMAIL,
|
settings.DEFAULT_FROM_EMAIL,
|
||||||
[email],
|
[email],
|
||||||
fail_silently=False,
|
fail_silently=False,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue