changeset 1056:ac41aecf797d

Make use of next param on login link.
author Brian Neal <bgneal@gmail.com>
date Thu, 17 Mar 2016 20:03:20 -0500
parents 6ce40d6f39de
children afb6fbd0dc45
files sg101/templates/v3/base.html
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/sg101/templates/v3/base.html	Thu Mar 17 19:45:35 2016 -0500
+++ b/sg101/templates/v3/base.html	Thu Mar 17 20:03:20 2016 -0500
@@ -35,7 +35,11 @@
                   {% unread_messages %}</a></li>
                <li><a href="{% url 'accounts-logout' %}">Logout</a></li>
             {% else %}
-               <li><a href="{% url 'accounts-login' %}">Login</a></li>
+               {% if request.path != "/accounts/logout/" %}
+                  <li><a href="{% url 'accounts-login' %}?next={{ request.path }}">Login</a></li>
+               {% else %}
+                  <li><a href="{% url 'accounts-login' %}">Login</a></li>
+               {% endif %}
                <li><a href="{% url 'accounts-register' %}">Register</a></li>
             {% endif %}
          </ul>