use tag for testing

This commit is contained in:
Matthias 2021-10-07 17:31:18 +02:00
parent c83d244663
commit c37e40d144
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076
2 changed files with 8 additions and 1 deletions

View File

@ -351,6 +351,12 @@ def object_link(url_name, pk, ref):
return mark_safe('<b><a href="{}">{}</a></b>'.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

View File

@ -7,13 +7,14 @@
{% block content %}
{% settings_value 'LOGIN_ENABLE_PWD_FORGOT' as enable_pwd_forgot %}
{% mail_configured as mail_conf %}
<h1>{% trans "Password Reset" %}</h1>
{% if user.is_authenticated %}
{% include "account/snippets/already_logged_in.html" %}
{% endif %}
{% if enable_pwd_forgot %}
{% if mail_conf and enable_pwd_forgot %}
<p>{% trans "Forgotten your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it." %}</p>
<form method="POST" action="{% url 'account_reset_password' %}" class="password_reset">