Self hosted FLOSS fitness/workout, nutrition and weight tracker
Correctly redirect to previous URL after login
Roland Geider2ebbcfb7f607
diff --git a/wger/core/templates/user/login.html b/wger/core/templates/user/login.htmlindex 77936836b..7433c4724 100644--- a/wger/core/templates/user/login.html+++ b/wger/core/templates/user/login.html@@ -12,7 +12,7 @@{% endblock %}{% block content %}-<form action="{% url 'core:login' %}"+<form action="{% url 'core:login' %}{% if next %}?next={{next}}{% endif %}"method="post"class="form-horizontal">{% trans 'Login' as submit_text %}diff --git a/wger/core/views/user.py b/wger/core/views/user.pyindex da8b591c9..cc93b9417 100644--- a/wger/core/views/user.py+++ b/wger/core/views/user.py@@ -50,7 +50,8 @@ def login(request):'''context = {'hide_persona': check_request_amazon(request) or check_request_android(request),- 'active_tab': USER_TAB}+ 'active_tab': USER_TAB,+ 'next': request.REQUEST.get('next')}return django_loginview(request,template_name='user/login.html',extra_context=context)