Can you reproduce this error in a fresh welcome app?

Then you can send just the one line?

Is it solely:

; auth
[auth]
create_user_groups = 1

VS

; auth
[auth]
create_user_groups = 0

?



On Thu, Nov 19, 2015 at 10:44 PM, 黄祥 <steve.van.chris...@gmail.com> wrote:

> pardon, i just tried, what is discussed in this thread on my
> configuration, parsing as string .'auth.create_user_groups' not
> auth.create_user_groups as a variable
> e.g.
> models/db.py
> auth.settings.create_user_groups = False
>
> i want to change the configuration into privates/appconfig.ini with :
> 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) ) )
>
> but it returns an error when i set the value in privates/appconfig.ini
> into 1
>
> any idea?
>
> thanks n best regards,
> stifan
>
>
> On Friday, November 20, 2015 at 11:36:33 AM UTC+7, Mark Graves wrote:
>>
>> I just tried to reproduce your error and could not.
>>
>> Judging from the error, are you sure you are passing in the string
>> 'auth.create_user_groups' and not auth.create_user_groups as a variable?
>>
>>
>>
>> On Thu, Nov 19, 2015 at 9:32 PM, 黄祥 <steve.van...@gmail.com> wrote:
>>
>>> 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 a topic in the
>>> Google Groups "web2py-users" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/web2py/rohbrJEZG_E/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> web2py+un...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/rohbrJEZG_E/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.

Reply via email to