remove un-necessary checks
This commit is contained in:
1 parent
ca85d9adab
commit
7714b5dc7b
2 files changed
+6
-6
No files matched your search
@@ -1 +1 @@
|
|||||||
Version 2.4.5-stable+timestamp.2013.04.01.14.38.34
|
Version 2.4.5-stable+timestamp.2013.04.01.19.18.09
|
||||||
+5
-5
@@ -1902,7 +1902,7 @@ class SQLFORM(FORM):
|
|||||||
tablename = table._tablename
|
tablename = table._tablename
|
||||||
if upload == '<default>':
|
if upload == '<default>':
|
||||||
upload = lambda filename: url(args=['download', filename])
|
upload = lambda filename: url(args=['download', filename])
|
||||||
if len(request.args) > 1 and request.args[-2] == 'download':
|
if request.args(-2) == 'download':
|
||||||
stream = response.download(request, db)
|
stream = response.download(request, db)
|
||||||
raise HTTP(200, stream, **response.headers)
|
raise HTTP(200, stream, **response.headers)
|
||||||
|
|
||||||
@@ -1939,7 +1939,7 @@ class SQLFORM(FORM):
|
|||||||
create_form = update_form = view_form = search_form = None
|
create_form = update_form = view_form = search_form = None
|
||||||
sqlformargs = dict(formargs)
|
sqlformargs = dict(formargs)
|
||||||
|
|
||||||
if create and len(request.args) > 1 and request.args[-2] == 'new':
|
if create and request.args(-2) == 'new':
|
||||||
table = db[request.args[-1]]
|
table = db[request.args[-1]]
|
||||||
sqlformargs.update(createargs)
|
sqlformargs.update(createargs)
|
||||||
create_form = SQLFORM(
|
create_form = SQLFORM(
|
||||||
@@ -1958,7 +1958,7 @@ class SQLFORM(FORM):
|
|||||||
res.search_form = search_form
|
res.search_form = search_form
|
||||||
return res
|
return res
|
||||||
|
|
||||||
elif details and len(request.args) > 2 and request.args[-3] == 'view':
|
elif details and request.args(-3) == 'view':
|
||||||
table = db[request.args[-2]]
|
table = db[request.args[-2]]
|
||||||
record = table(request.args[-1]) or redirect(referrer)
|
record = table(request.args[-1]) or redirect(referrer)
|
||||||
sqlformargs.update(viewargs)
|
sqlformargs.update(viewargs)
|
||||||
@@ -1973,7 +1973,7 @@ class SQLFORM(FORM):
|
|||||||
res.view_form = view_form
|
res.view_form = view_form
|
||||||
res.search_form = search_form
|
res.search_form = search_form
|
||||||
return res
|
return res
|
||||||
elif editable and len(request.args) > 2 and request.args[-3] == 'edit':
|
elif editable and request.args(-3) == 'edit':
|
||||||
table = db[request.args[-2]]
|
table = db[request.args[-2]]
|
||||||
record = table(request.args[-1]) or redirect(URL('error'))
|
record = table(request.args[-1]) or redirect(URL('error'))
|
||||||
sqlformargs.update(editargs)
|
sqlformargs.update(editargs)
|
||||||
@@ -1998,7 +1998,7 @@ class SQLFORM(FORM):
|
|||||||
res.view_form = view_form
|
res.view_form = view_form
|
||||||
res.search_form = search_form
|
res.search_form = search_form
|
||||||
return res
|
return res
|
||||||
elif deletable and len(request.args) > 2 and request.args[-3] == 'delete':
|
elif deletable and request.args(-3) == 'delete':
|
||||||
table = db[request.args[-2]]
|
table = db[request.args[-2]]
|
||||||
if ondelete:
|
if ondelete:
|
||||||
ondelete(table, request.args[-1])
|
ondelete(table, request.args[-1])
|
||||||
|
|||||||
Reference in new issue
Block a user