Ticket #16842: django13-redirects.patch
File django13-redirects.patch, 1.5 KB (added by , 13 years ago) |
---|
-
django/views/generic/simple.py
a b 48 48 from the request is appended to the URL. 49 49 50 50 """ 51 args = request.META["QUERY_STRING"] 52 if args and query_string and url is not None: 53 url = "%s?%s" % (url, args) 51 if url is not None: 52 url = url % kwargs 53 args = request.META["QUERY_STRING"] 54 if args and query_string: 55 url = "%s?%s" % (url, args) 54 56 55 if url is not None:56 57 klass = permanent and HttpResponsePermanentRedirect or HttpResponseRedirect 57 return klass(url % kwargs)58 return klass(url) 58 59 else: 59 60 logger.warning('Gone: %s' % request.path, 60 61 extra={ -
django/views/generic/base.py
a b 138 138 are provided as kwargs to this method. 139 139 """ 140 140 if self.url: 141 url = self.url % kwargs 141 142 args = self.request.META["QUERY_STRING"] 142 143 if args and self.query_string: 143 url = "%s?%s" % (self.url, args) 144 else: 145 url = self.url 146 return url % kwargs 144 url = "%s?%s" % (url, args) 145 return url 147 146 else: 148 147 return None 149 148