Opened 9 years ago

Closed 7 years ago

#10824 closed (duplicate)

GET infos is lost

Reported by: roboter <songbf@…> Owned by: nobody
Component: contrib.admin Version: master
Severity: Keywords: GET info
Cc: Triage Stage: Someday/Maybe
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


on the django admin,i new a model with GET info,the url is like:/admin/xxapp/a/add/?name=test.[[BR]]

but when click "Save and add another",the new url is "/admin/xxapp/a/add/","?name=test" had losted.

i goto django/contrib/admin/,find a function:

def response_add(self, request, obj, post_url_continue='../%s/'):
   elif request.POST.has_key("_addanother"):
      self.message_user(request, msg + ' ' + (_("You may add another %s below.") % force_unicode(opts.verbose_name)))
      return HttpResponseRedirect(request.path)

this code lost GET info,please fix.
and i write some code:

getinfos = request.GET.items()
gets = '?'
for info in getinfos:
    gets += '%s=%s&' % (info[0],info[1])

path = request.path + gets
return HttpResponseRedirect(path)

Change History (3)

comment:1 Changed 9 years ago by Malcolm Tredinnick

milestone: 1.1

This is a feature addition, not a bug fix to documented behaviour. We're not currently guaranteeing that query parameters are passed to the "add" option. Worth thinking about for a future release, though (scoping out the full problem for all admin resources is going to be necessary).

Removing from the 1.1 milestone.

comment:2 Changed 9 years ago by Chris Beaven

Triage Stage: UnreviewedSomeday/Maybe

comment:3 Changed 7 years ago by Julien Phalip

Resolution: duplicate
Status: newclosed

This is a dupe of #12241 which, although it is more recent, contains more thorough discussions and has patches.

Note: See TracTickets for help on using tickets.
Back to Top