Ticket #13883: options.py-corrected.diff

File options.py-corrected.diff, 1.1 KB (added by bsimons, 13 years ago)

update of patch for options.py made to work with trunk

  • django/contrib/admin/options.py

     
    738738            return HttpResponseRedirect(post_url_continue % pk_value)
    739739
    740740        if "_popup" in request.POST:
    741             return HttpResponse('<script type="text/javascript">opener.dismissAddAnotherPopup(window, "%s", "%s");</script>' % \
     741            if hasattr(self, 'list_grouping') and self.list_grouping:
     742                grp = escape(getattr(obj, self.list_grouping))
     743            else:
     744                grp = ''
     745            return HttpResponse('<script type="text/javascript">opener.dismissAddAnotherPopup(window, "%s", "%s", "%s");</script>' % \
    742746                # escape() calls force_unicode.
    743                 (escape(pk_value), escapejs(obj)))
     747                (escape(pk_value), escape(obj), grp))
    744748        elif "_addanother" in request.POST:
    745749            self.message_user(request, msg + ' ' + (_("You may add another %s below.") % force_unicode(opts.verbose_name)))
    746750            return HttpResponseRedirect(request.path)
Back to Top