better URL errors, thanks Mariano
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 1.99.7 (2012-04-07 19:55:06) dev
|
Version 1.99.7 (2012-04-07 20:04:15) dev
|
||||||
|
|||||||
+3
-1
@@ -261,6 +261,8 @@ def URL(
|
|||||||
else:
|
else:
|
||||||
raise SyntaxError, 'when calling URL, function or function name required'
|
raise SyntaxError, 'when calling URL, function or function name required'
|
||||||
elif '/' in f:
|
elif '/' in f:
|
||||||
|
if f.startswith("/"):
|
||||||
|
f = f[1:]
|
||||||
items = f.split('/')
|
items = f.split('/')
|
||||||
function = f = items[0]
|
function = f = items[0]
|
||||||
args = items[1:] + args
|
args = items[1:] + args
|
||||||
@@ -277,7 +279,7 @@ def URL(
|
|||||||
function2 = '%s.%s' % (function,extension or 'html')
|
function2 = '%s.%s' % (function,extension or 'html')
|
||||||
|
|
||||||
if not (application and controller and function):
|
if not (application and controller and function):
|
||||||
raise SyntaxError, 'not enough information to build the url'
|
raise SyntaxError, 'not enough information to build the url (%s %s %s)' % (application, controller, function)
|
||||||
|
|
||||||
if args:
|
if args:
|
||||||
if url_encode:
|
if url_encode:
|
||||||
|
|||||||
Reference in New Issue
Block a user