Opened 16 years ago

Closed 14 years ago

#10824 closed (duplicate)

GET infos is lost

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

Description

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/options.py,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 by Malcolm Tredinnick, 16 years ago

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 by Chris Beaven, 15 years ago

Triage Stage: UnreviewedSomeday/Maybe

comment:3 by Julien Phalip, 14 years ago

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