mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
fix(SSO): log error message when EMAIL_HOST is empty (#6067)
fixes #4553
This commit is contained in:
parent
676a97b709
commit
b59cf0f4a4
@ -228,7 +228,12 @@ class CustomSignupForm(SignupForm):
|
||||
|
||||
def registration_enabled():
|
||||
"""Determine whether user registration is enabled."""
|
||||
return settings.EMAIL_HOST and (InvenTreeSetting.get_setting('LOGIN_ENABLE_REG') or InvenTreeSetting.get_setting('LOGIN_ENABLE_SSO_REG'))
|
||||
if InvenTreeSetting.get_setting('LOGIN_ENABLE_REG') or InvenTreeSetting.get_setting('LOGIN_ENABLE_SSO_REG'):
|
||||
if settings.EMAIL_HOST:
|
||||
return True
|
||||
else:
|
||||
logger.error("Registration cannot be enabled, because EMAIL_HOST is not configured.")
|
||||
return False
|
||||
|
||||
|
||||
class RegistratonMixin:
|
||||
|
Loading…
Reference in New Issue
Block a user