Skip to content

Commit

Permalink
Merge pull request #3819 from jsma/patch-3818
Browse files Browse the repository at this point in the history
Prevents login form from redirecting to logout.
  • Loading branch information
mkoistinen committed Feb 13, 2015
2 parents 560767f + 5796a77 commit 7fe76e5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cms/templates/cms/toolbar/items/login.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{% load i18n sekizai_tags cms_tags %}
{% load url from future %}
<form class="cms_toolbar-item cms_form-login" method="post" action="{% url 'pages-root' %}?next={{ request.path }}&amp;edit&amp;cms-toolbar-login=1">
{% url 'logout' as logout_url %}
<form class="cms_toolbar-item cms_form-login" method="post" action="{% url 'pages-root' %}{% if request.path != logout_url %}?next={{ request.path }}&amp;edit&amp;cms-toolbar-login=1{% endif %}">
{% csrf_token %}
<label{% if request.toolbar.login_form.username.errors %} class="cms_error"{% endif %}><span>{% trans "Username" %}</span> {{ request.toolbar.login_form.username }}</label>
<label{% if request.toolbar.login_form.password.errors or request.toolbar.login_form.non_field_errors or cms_toolbar_login_error %} class="cms_error"{% endif %}><span>{% trans "Password" %}</span> {{ request.toolbar.login_form.password }}</label>
Expand Down

0 comments on commit 7fe76e5

Please sign in to comment.