rif / web2admin

web2py administration plugin
26 stars 10 forks source link

NameError: name 'check_access' is not defined #9

Closed rochacbruno closed 10 years ago

rochacbruno commented 10 years ago

Probably web2py conditional models are not working

Here in models https://github.com/rif/web2admin/blob/master/models/plugin_web2admin.py#L4 it cheched if the requested controller is 'web2admin' and them models_to_run are build. Probably it is not working in newer versions of web2py.

Traceback (most recent call last):
  File "/home/web2admin/web2py/gluon/restricted.py", line 217, in restricted
    exec ccode in environment
  File "/home/web2admin/web2py/applications/welcome/controllers/plugin_web2admin.py", line 6, in <module>
    @auth.requires(check_access(a0, 'w2a_read'))
NameError: name 'check_access' is not defined
rochacbruno commented 10 years ago

Created a post on web2py-users group

rochacbruno commented 10 years ago

I guess this is now fixed by https://github.com/web2py/web2py/commit/257733e0cc9e60e9815f4733e8abcef42b4b4916