mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Merge branch 'master' of https://github.com/inventree/InvenTree into onboarding-group
This commit is contained in:
commit
f478a6236f
@ -9,6 +9,7 @@ import logging
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django import forms
|
||||
from django.contrib.auth.models import User, Group
|
||||
from django.conf import settings
|
||||
|
||||
from crispy_forms.helper import FormHelper
|
||||
from crispy_forms.layout import Layout, Field
|
||||
@ -260,7 +261,7 @@ class RegistratonMixin:
|
||||
Mixin to check if registration should be enabled
|
||||
"""
|
||||
def is_open_for_signup(self, request):
|
||||
if InvenTreeSetting.get_setting('EMAIL_HOST', None) and InvenTreeSetting.get_setting('LOGIN_ENABLE_REG', True):
|
||||
if settings.EMAIL_HOST and InvenTreeSetting.get_setting('LOGIN_ENABLE_REG', True):
|
||||
return super().is_open_for_signup(request)
|
||||
return False
|
||||
|
||||
@ -283,7 +284,7 @@ class CustomAccountAdapter(RegistratonMixin, DefaultAccountAdapter):
|
||||
"""
|
||||
def send_mail(self, template_prefix, email, context):
|
||||
"""only send mail if backend configured"""
|
||||
if InvenTreeSetting.get_setting('EMAIL_HOST', None):
|
||||
if settings.EMAIL_HOST:
|
||||
return super().send_mail(template_prefix, email, context)
|
||||
return False
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user