mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-05 06:08:46 -05:00
disable password reset if no mail is set
This commit is contained in:
@@ -16,7 +16,7 @@ class AllAuthCustomAdapter(DefaultAccountAdapter):
|
|||||||
|
|
||||||
# disable password reset for now
|
# disable password reset for now
|
||||||
def send_mail(self, template_prefix, email, context):
|
def send_mail(self, template_prefix, email, context):
|
||||||
if settings.EMAIL_HOST == '':
|
if settings.EMAIL_HOST != '':
|
||||||
super(AllAuthCustomAdapter, self).send_mail(template_prefix, email, context)
|
super(AllAuthCustomAdapter, self).send_mail(template_prefix, email, context)
|
||||||
else:
|
else:
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -27,7 +27,11 @@
|
|||||||
|
|
||||||
<button class="btn btn-primary" type="submit">{% trans "Sign In" %}</button>
|
<button class="btn btn-primary" type="submit">{% trans "Sign In" %}</button>
|
||||||
<a class="btn btn-success" href="{% url 'account_signup' %}">{% trans "Sign Up" %}</a>
|
<a class="btn btn-success" href="{% url 'account_signup' %}">{% trans "Sign Up" %}</a>
|
||||||
<a class="btn btn-secondary" href="{% url 'account_reset_password' %}">{% trans "Reset Password" %}</a>
|
|
||||||
|
{% if settings.EMAIL_HOST != '' %}
|
||||||
|
<a class="btn btn-secondary"
|
||||||
|
href="{% url 'account_reset_password' %}">{% trans "Reset Password" %}</a>
|
||||||
|
{% endif %}
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,23 +4,29 @@
|
|||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% load account %}
|
{% load account %}
|
||||||
|
|
||||||
{% block head_title %}{% trans "Password Reset" %}{% endblock %}
|
{% block title %}{% trans 'Password Reset' %}{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<h3>{% trans "Password Reset" %}</h3>
|
<h3>{% trans "Password Reset" %}</h3>
|
||||||
{% if user.is_authenticated %}
|
{% if user.is_authenticated %}
|
||||||
{% include "account/snippets/already_logged_in.html" %}
|
{% include "account/snippets/already_logged_in.html" %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if settings.EMAIL_HOST != '' %}
|
||||||
|
<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">
|
||||||
|
{% csrf_token %}
|
||||||
|
{{ form | crispy }}
|
||||||
|
<input type="submit" class="btn btn-success" value="{% trans 'Reset My Password' %}"/>
|
||||||
|
<a class="btn btn-primary" href="{% url 'account_login' %}">{% trans "Sign In" %}</a>
|
||||||
|
<a class="btn btn-info" href="{% url 'account_signup' %}">{% trans "Sign Up" %}</a>
|
||||||
|
</form>
|
||||||
|
{% else %}
|
||||||
|
<p>{% trans 'Password reset is disabled on this instance.' %}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<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">
|
|
||||||
{% csrf_token %}
|
|
||||||
{{ form | crispy}}
|
|
||||||
<input type="submit" class="btn btn-primary" value="{% trans 'Reset My Password' %}" />
|
|
||||||
<a class="btn btn-primary" href="{% url 'account_login' %}">{% trans "Sign In" %}</a>
|
|
||||||
<a class="btn btn-success" href="{% url 'account_signup' %}">{% trans "Sign Up" %}</a>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% load account %}
|
{% load account %}
|
||||||
|
|
||||||
{% block head_title %}{% trans "Password Reset" %}{% endblock %}
|
{% block title %}{% trans "Password Reset" %}{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h3>{% trans "Password Reset" %}</h3>
|
<h3>{% trans "Password Reset" %}</h3>
|
||||||
|
|||||||
@@ -2,13 +2,12 @@
|
|||||||
|
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
{% block head_title %}{% trans "Sign Up Closed" %}{% endblock %}
|
{% block title %}{% trans "Sign Up Closed" %}{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>{% trans "Sign Up Closed" %}</h1>
|
<h1>{% trans "Sign Up Closed" %}</h1>
|
||||||
|
|
||||||
<p>{% trans "We are sorry, but the sign up is currently closed." %}</p>
|
<p>{% trans "We are sorry, but the sign up is currently closed." %}</p>
|
||||||
|
|
||||||
<a class="btn btn-primary" href="{% url 'account_login' %}">{% trans "Sign In" %}</a>
|
<a class="btn btn-primary" href="{% url 'account_login' %}">{% trans "Sign In" %}</a>
|
||||||
<a class="btn btn-secondary" href="{% url 'account_reset_password' %}">{% trans "Reset Password" %}</a>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user