diff --git a/InvenTree/part/templatetags/inventree_extras.py b/InvenTree/part/templatetags/inventree_extras.py index ce4ead853a..dab7be6eb9 100644 --- a/InvenTree/part/templatetags/inventree_extras.py +++ b/InvenTree/part/templatetags/inventree_extras.py @@ -351,6 +351,12 @@ def object_link(url_name, pk, ref): return mark_safe('{}'.format(ref_url, ref)) +@register.simple_tag() +def mail_configured(): + """ Return if mail is configured """ + return bool(settings.EMAIL_HOST) + + class I18nStaticNode(StaticNode): """ custom StaticNode diff --git a/InvenTree/templates/account/password_reset.html b/InvenTree/templates/account/password_reset.html index d28110b81c..2cfb45a716 100644 --- a/InvenTree/templates/account/password_reset.html +++ b/InvenTree/templates/account/password_reset.html @@ -7,13 +7,14 @@ {% block content %} {% settings_value 'LOGIN_ENABLE_PWD_FORGOT' as enable_pwd_forgot %} +{% mail_configured as mail_conf %}

{% trans "Password Reset" %}

{% if user.is_authenticated %} {% include "account/snippets/already_logged_in.html" %} {% endif %} - {% if enable_pwd_forgot %} + {% if mail_conf and enable_pwd_forgot %}

{% trans "Forgotten your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it." %}