1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Fixed #28907 -- Removed unnecessary if statements.

This commit is contained in:
Tim Graham
2017-12-07 17:12:00 -05:00
committed by GitHub
parent c6864a01b2
commit 02d9419fe3
3 changed files with 41 additions and 45 deletions

View File

@@ -1363,16 +1363,15 @@ def url(parser, token):
asvar = bits[-1]
bits = bits[:-2]
if bits:
for bit in bits:
match = kwarg_re.match(bit)
if not match:
raise TemplateSyntaxError("Malformed arguments to url tag")
name, value = match.groups()
if name:
kwargs[name] = parser.compile_filter(value)
else:
args.append(parser.compile_filter(value))
for bit in bits:
match = kwarg_re.match(bit)
if not match:
raise TemplateSyntaxError("Malformed arguments to url tag")
name, value = match.groups()
if name:
kwargs[name] = parser.compile_filter(value)
else:
args.append(parser.compile_filter(value))
return URLNode(viewname, args, kwargs, asvar)