Skip to content

Commit 2daf1ae

Browse files
committed
Stopped converting match dict keys to bytestrings when resolving URLs.
Test suite is passing, but if any regression would be detected, we might replace smart_str by force_unicode.
1 parent 1e6c336 commit 2daf1ae

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

django/core/urlresolvers.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,10 +306,8 @@ def resolve(self, path):
306306
tried.append([pattern])
307307
else:
308308
if sub_match:
309-
sub_match_dict = dict([(smart_str(k), v) for k, v in match.groupdict().items()])
310-
sub_match_dict.update(self.default_kwargs)
311-
for k, v in sub_match.kwargs.iteritems():
312-
sub_match_dict[smart_str(k)] = v
309+
sub_match_dict = dict(match.groupdict(), **self.default_kwargs)
310+
sub_match_dict.update(sub_match.kwargs)
313311
return ResolverMatch(sub_match.func, sub_match.args, sub_match_dict, sub_match.url_name, self.app_name or sub_match.app_name, [self.namespace] + sub_match.namespaces)
314312
tried.append([pattern])
315313
raise Resolver404({'tried': tried, 'path': new_path})

0 commit comments

Comments
 (0)