Fix bug with compiled views in compiled-only apps
Compiled views were not being executed in apps containing only compiled files (i.e., generated via the admin "Pack compiled" functionality), resulting in "Invalid view" errors for all pages.
This commit is contained in:
+2
-3
@@ -709,6 +709,8 @@ def run_view_in(environment):
|
|||||||
ccode = getcfs(compiled, compiled, lambda: read_pyc(compiled))
|
ccode = getcfs(compiled, compiled, lambda: read_pyc(compiled))
|
||||||
layer = compiled
|
layer = compiled
|
||||||
break
|
break
|
||||||
|
# if the view is not compiled
|
||||||
|
if not layer:
|
||||||
if not os.path.exists(filename) and allow_generic:
|
if not os.path.exists(filename) and allow_generic:
|
||||||
view = 'generic.' + request.extension
|
view = 'generic.' + request.extension
|
||||||
filename = pjoin(folder, 'views', view)
|
filename = pjoin(folder, 'views', view)
|
||||||
@@ -716,9 +718,6 @@ def run_view_in(environment):
|
|||||||
raise HTTP(404,
|
raise HTTP(404,
|
||||||
rewrite.THREAD_LOCAL.routes.error_message % badv,
|
rewrite.THREAD_LOCAL.routes.error_message % badv,
|
||||||
web2py_error=badv)
|
web2py_error=badv)
|
||||||
|
|
||||||
# if the view is not compiled
|
|
||||||
if not layer:
|
|
||||||
# Parse template
|
# Parse template
|
||||||
scode = parse_template(view,
|
scode = parse_template(view,
|
||||||
pjoin(folder, 'views'),
|
pjoin(folder, 'views'),
|
||||||
|
|||||||
Reference in New Issue
Block a user