tested it. return an error if i put the value int = 1 as true in appconfig.ini e.g. privates/appconfig.ini [auth] create_user_groups = 0 ; return an error traceback when value = 1, when value = 0, no error occured, works as expected
models/db.py auth.settings.create_user_groups = myconf.take('auth.create_user_groups', cast = lambda value: bool(int(value) ) ) error traceback: Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. Traceback (most recent call last): File "/Users/MacBookPro/site/web2py/gluon/restricted.py", line 227, in restricted exec ccode in environment File "/Users/MacBookPro/site/web2py/applications/testing/controllers/default.py" <http://127.0.0.1:8000/admin/default/edit/trucking/controllers/default.py>, line 44, in <module> File "/Users/MacBookPro/site/web2py/gluon/globals.py", line 412, in <lambda> self._caller = lambda f: f() File "/Users/MacBookPro/site/web2py/applications/testing/controllers/default.py" <http://127.0.0.1:8000/admin/default/edit/trucking/controllers/default.py>, line 19, in user return dict(form=auth()) File "/Users/MacBookPro/site/web2py/gluon/tools.py", line 1614, in __call__ return getattr(self, args[0])() File "/Users/MacBookPro/site/web2py/gluon/tools.py", line 2939, in register self.settings.create_user_groups % form.vars, description) TypeError: unsupported operand type(s) for %: 'bool' and 'Storage' Error snapshot [image: help] <http://127.0.0.1:8000/admin/default/ticket/trucking/127.0.0.1.2015-11-20.10-29-10.a297daff-fb06-4ea8-877a-af0fd8928f0d#> <type 'exceptions.TypeError'>(unsupported operand type(s) for %: 'bool' and 'Storage') -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.