Permalink
Browse files

fix redirect_field_name support of signin

  • Loading branch information...
1 parent 0aaac9a commit f8e169ec855fc40111d9eadbc88639854aa974ad flc committed Aug 24, 2011
Showing with 6 additions and 2 deletions.
  1. +2 −1 userena/templates/userena/signin_form.html
  2. +4 −1 userena/views.py
@@ -18,13 +18,14 @@
</p>
{% else %}
<p>
- {{ field.label_tag }}
+ {{ field.label_tag }}
{{ field }}
</p>
{% endif %}
{% endfor %}
</fieldset>
<input type="submit" value="{% trans "Signin" %}" />
<p class="forgot-password"><a href="{% url userena_password_reset %}" title="{% trans "Forgot your password?" %}">{% trans "Forgot your password?" %}</a></p>
+ {% if next %}<input type="hidden" name="next" value="{{ next }}" />{% endif %}
</form>
{% endblock %}
View
@@ -303,7 +303,10 @@ def signin(request, auth_form=AuthenticationForm,
kwargs={'username': user.username}))
if not extra_context: extra_context = dict()
- extra_context['form'] = form
+ extra_context.update({
+ 'form': form,
+ 'next': request.REQUEST.get(redirect_field_name),
+ })
return direct_to_template(request,
template_name,
extra_context=extra_context)

0 comments on commit f8e169e

Please sign in to comment.