2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-30 20:46:47 +00:00

do not send if not configured

This commit is contained in:
Matthias 2021-10-07 17:42:20 +02:00
parent 6c0c8bf1b6
commit 9a310bdd5c
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -266,6 +266,11 @@ class CustomAccountAdapter(RegistratonMixin, DefaultAccountAdapter):
""" """
Override of adapter to use dynamic settings Override of adapter to use dynamic settings
""" """
def send_mail(self, template_prefix, email, context):
"""only send mail if backend configured"""
if InvenTreeSetting.get_setting('EMAIL_HOST', None):
return super().send_mail(template_prefix, email, context)
return False
class CustomSocialAccountAdapter(RegistratonMixin, DefaultSocialAccountAdapter): class CustomSocialAccountAdapter(RegistratonMixin, DefaultSocialAccountAdapter):