Ticket #2986: javascript.patch
File javascript.patch, 950 bytes (added by , 18 years ago) |
---|
-
django/contrib/admin/views/main.py
266 266 if type(pk_value) is str: # Quote if string, so JavaScript doesn't think it's a variable. 267 267 pk_value = '"%s"' % pk_value.replace('"', '\\"') 268 268 return HttpResponse('<script type="text/javascript">opener.dismissAddAnotherPopup(window, %s, "%s");</script>' % \ 269 (pk_value, str(new_object).replace('"', '\\"') ))269 (pk_value, str(new_object).replace('"', '\\"').replace('\n', ' '))) 270 270 elif request.POST.has_key("_addanother"): 271 271 request.user.message_set.create(message=msg + ' ' + (_("You may add another %s below.") % opts.verbose_name)) 272 272 return HttpResponseRedirect(request.path)