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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user