redirect user to 'helpdesk_home' from /helpdesk/login/ page, if user is already authenticated.

This commit is contained in:
Andreas Kotowicz 2011-11-23 19:57:11 +01:00
parent 4b0b628724
commit 1eb0760f32

View File

@ -2,19 +2,24 @@
{% block helpdesk_title %}{% trans "Helpdesk Login" %}{% endblock %}
{% block helpdesk_body %}
<h2>{% trans "Login" %}</h2>
<p>{% trans "To log in and begin responding to cases, simply enter your username and password below." %}</p>
{% if request.user.is_authenticated %}
<meta http-equiv="REFRESH" content="0;url={% url helpdesk_home %}">
{% else %}
<h2>{% trans "Login" %}</h2>
<form method='post' action='./'>
{% if form.errors %}<p>{% trans "Your username and password didn't match. Please try again." %}</p>{% endif %}
<dl>
<dt><label>{% trans "Username" %}</label></dt>
<dd>{{ form.username }}</dd>
<dt><label>{% trans "Password" %}</label></dt>
<dd>{{ form.password }}</dd>
</dl>
<input type='submit' value='{% trans "Login" %}' />
<input type="hidden" name="next" value="{% if next %}{{ next }}{% else %}../{% endif %}" />
{% csrf_token %}</form>
<p>{% trans "To log in and begin responding to cases, simply enter your username and password below." %}</p>
<form method='post' action='./'>
{% if form.errors %}<p>{% trans "Your username and password didn't match. Please try again." %}</p>{% endif %}
<dl>
<dt><label>{% trans "Username" %}</label></dt>
<dd>{{ form.username }}</dd>
<dt><label>{% trans "Password" %}</label></dt>
<dd>{{ form.password }}</dd>
</dl>
<input type='submit' value='{% trans "Login" %}' />
<input type="hidden" name="next" value="{% if next %}{{ next }}{% else %}../{% endif %}" />
{% csrf_token %}</form>
{% endif %}
{% endblock %}