forked from orbit-oss/flask
There was a duplicated call to url_adapter.build(...)
try:
rv = url_adapter.build(endpoint, values, method=method,
force_external=external)
except BuildError, error:
# We need to inject the values again so that the app callback can
# deal with that sort of stuff.
values['_external'] = external
values['_anchor'] = anchor
values['_method'] = method
return appctx.app.handle_url_build_error(error, endpoint, values)
rv = url_adapter.build(endpoint, values, method=method,
force_external=external)
If no exception was raised for url_adapter.build(...) then the same method call
would be made after the try...except block. This is unnecessary.
This commit is contained in:
parent
a15c6c569a
commit
275f830c83
1 changed files with 0 additions and 2 deletions
|
|
@ -295,8 +295,6 @@ def url_for(endpoint, **values):
|
|||
values['_method'] = method
|
||||
return appctx.app.handle_url_build_error(error, endpoint, values)
|
||||
|
||||
rv = url_adapter.build(endpoint, values, method=method,
|
||||
force_external=external)
|
||||
if anchor is not None:
|
||||
rv += '#' + url_quote(anchor)
|
||||
return rv
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue