Skip to content

Commit

Permalink
redirect user to 'helpdesk_home' from /helpdesk/login/ page, if user …
Browse files Browse the repository at this point in the history
…is already authenticated.
  • Loading branch information
kotowicz committed Nov 23, 2011
1 parent 4b0b628 commit 1eb0760
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions helpdesk/templates/helpdesk/registration/login.html
Expand Up @@ -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 %}

0 comments on commit 1eb0760

Please sign in to comment.