Add custom password reset check

This commit is contained in:
2020-06-20 03:48:31 +00:00
parent 1e685187df
commit c5767f033c
4 changed files with 18 additions and 3 deletions
+6 -1
View File
@@ -258,7 +258,12 @@ OLD_PASSWORD_FIELD_ENABLED = True
LOGOUT_ON_PASSWORD_CHANGE = False
ACCOUNT_PRESERVE_USERNAME_CASING = False
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
if not secrets.EMAIL_USER or not secrets.EMAIL_PASS:
logger.info('Logging outgoing emails to console')
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
else:
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp-relay.gmail.com'
EMAIL_PORT = '587'
EMAIL_HOST_USER = secrets.EMAIL_USER