Skip to content

Commit 524701e

Browse files
authored
Merge pull request #117 from SADiLaR/more-mail-settings
Format ADMINS setting as Django expects
2 parents e36730e + dc5231f commit 524701e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/app/settings.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,9 @@ def __contains__(self, address):
175175
DEFAULT_FROM_EMAIL = os.environ.get("DEFAULT_FROM_EMAIL", "webmaster@localhost")
176176
SERVER_EMAIL = os.environ.get("SERVER_EMAIL", "root@localhost")
177177
EMAIL_SUBJECT_PREFIX = os.environ.get("EMAIL_SUBJECT_PREFIX", "[Django] ")
178-
ADMINS = os.environ.get("ADMINS", "").split()
178+
# Format as: Name Surname [email protected], Name Surname [email protected]
179+
if _admins := os.environ.get("ADMINS", ""):
180+
ADMINS = [a.strip().rsplit(maxsplit=1) for a in _admins.split(",")]
179181

180182
email_backend_env = os.environ.get("EMAIL_BACKEND_CONSOLE", "False").lower() in ["true", "1", "yes"]
181183

0 commit comments

Comments
 (0)