allow URL('')

This commit is contained in:
mdipierro
2015-03-15 14:32:29 -05:00
parent c77683d80e
commit 198fbf9f59
+5 -5
View File
@@ -274,7 +274,7 @@ def URL(
if not isinstance(args, (list, tuple)): if not isinstance(args, (list, tuple)):
args = [args] args = [args]
if not r: if r is None:
if a and not c and not f: if a and not c and not f:
(f, a, c) = (a, c, f) (f, a, c) = (a, c, f)
elif a and c and not f: elif a and c and not f:
@@ -283,18 +283,18 @@ def URL(
if hasattr(current, 'request'): if hasattr(current, 'request'):
r = current.request r = current.request
if r: if r is not None:
application = r.application application = r.application
controller = r.controller controller = r.controller
function = r.function function = r.function
env = r.env env = r.env
if extension is None and r.extension != 'html': if extension is None and r.extension != 'html':
extension = r.extension extension = r.extension
if a: if a is not None:
application = a application = a
if c: if c is not None:
controller = c controller = c
if f: if f is not None:
if not isinstance(f, str): if not isinstance(f, str):
if hasattr(f, '__name__'): if hasattr(f, '__name__'):
function = f.__name__ function = f.__name__