#6903: Go back to old change_list view after hitting save
---------------------------------------------+------------------------------
          Reporter:  jarrow                  |         Owner:  ramiro           
        
            Status:  new                     |     Milestone:  post-1.0         
        
         Component:  django.contrib.admin    |       Version:  newforms-admin   
        
        Resolution:                          |      Keywords:  nfa-someday 
yandex-sprint
             Stage:  Design decision needed  |     Has_patch:  1                
        
        Needs_docs:  0                       |   Needs_tests:  1                
        
Needs_better_patch:  1                       |  
---------------------------------------------+------------------------------
Comment (by jacob):

 I've made a few stylistic improvements to the patch, but it still needs
 some fundamental improvement.

 The main problem is that "guessing" the return URL from HTTP_REFERER leads
 to strange behavior. For example:

   * Click "add" from the main admin index, then save the object. Result:
 you're returned to the index page. No, you should go to the changelist to
 inspect the object you just added.

   * Click "add" from anywhere. Click "save and add another". Click "save".
 Result: you're taken back to the ''last object you created''. This is
 '''really''' confusing: it appears identical to clicking "save and
 continue editing", except you've got different values.

 This needs to be fixed. I think probably the best approach is to *only*
 read the return URL from `GET`, and to modify the changelist to pass the
 return URL through as a `GET` variable. That is, rewrite the links from
 the changelist to include the return URL in the link.

 (This means you'll want to choose a different URL keyword to avoid
 conflicting with a field named `return_to`. Probably `_return_to`, I'd
 say.)

 Second, this patch needs some tests. Especially ones to make sure that the
 redirects stay sane in cases like above.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/6903#comment:12>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to