On Sat, 13 Feb 2010 13:22:54 +0000, Kev Dwyer wrote:

> Hello List,
> 
<snip>
> 
> Does anyone know how I can avoid hardcoding the post_change_redirect
> argument to change_password, either in urls.py or perhaps by some
> trickery in the template or form?
> 
> Many thanks,
> 
> Kev


I've worked around this by copying the auth.views.change_password() 
function into my app's views.py and modifying it so it attempts to 
reverse() the post_change_redirect argument, thus permitting 
post_change_redirect to be a view.  The reverse() is wrapped by a 
try/except NoReverseMatch block so that if the reverse() fails the
original post_change_redirect string will be used for the redirect.

Two questions:
 - Does this seem like a sensible thing to do or am I reinventing the
wheel somehow?

 - Assuming that I'm not reinventing the wheel, does anyone think
it's worthwhile submitting this as a patch?

Cheers,

Kev

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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