Fixed #19044 -- Allow get_success_url to access self.object in DeletionMixin #417

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
4 participants

generic_views tests passes

Member

mjtamlyn commented Oct 3, 2012

I don't think the get_success_url method needs to change - it seems a pretty odd change to me anyway. The change to delete looks good though and makes sense.

Please take a look at https://code.djangoproject.com/ticket/19044
Change to get_success_url is necessary for example to redirect to object parent after its deletion

Member

charettes commented Oct 3, 2012

IMHO you shouldn't refer to an URL this way, you should use the reverse_lazy function here.

I have to agree with @mjtamlyn about the changes of the get_success_url method. You just can't assume that the specified success_url should be formatted using the instance's __dict__.

Why get_success_url of DeletionMixin cannot format url in the same way as get_success_url of ModelFormMixin in the same file?

Member

mjtamlyn commented Oct 3, 2012

Sorry, didn't realise it was a consistency thing. In that case the change should be there for consistency purposes, although I still think the feature smells ;)

Member

charettes commented Oct 3, 2012

@0x0badc0de please forgive me, didn't notice that. I wonder if it's documented somewhere.

Owner

apollo13 commented Oct 27, 2012

Needs tests as noted on the ticket.

Member

charettes commented Feb 5, 2013

#663 has tests.

@charettes charettes closed this Feb 5, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment