Hello,

You can add a hidden input named "next" where you put the value of next in
the GET variable.
Like this
<form method="post" action="{{ some_action }}" ... >
....
<input type="hidden" name="next" value="{{ request.GET.next }}" />
....
</form>

Or you can change the action variable of the form to include the current GET
variables. like this

<form method="post" action="{{ request.get_full_path }}" ... >
....
</form>

If your view that handles GET and POST aren't the same you must add the
"next" var in the action field on your own.


The latter is the best IMHO.

Hope that helps!

Regards,
Matias.




On Mon, Dec 22, 2008 at 11:47 AM, Jarek Zgoda <jarek.zg...@gmail.com> wrote:

>
> I'm seeing strange behaviour of login_required decorator: any view
> decorated with it first sends to login page, then to url defined in
> LOGIN_REDIRECT_URL. The url to decorated view is supplied in next
> parameter (/login/?next=/path/to/view/) but is never executed.
>
> Looking at login view code I see that the redirect is taken from
> redirect_field_name field (which in my case is default "next") of
> REQUEST. This works as I expect if I do GET, but this value is not set
> if I issue POST request with credentials after displaying form.
>
> Do I have to write my own login machinery to achieve such
> functionality (redirect to decorated view after login)?
>
> Cheers
> J.
> >
>


-- 
:wq

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to