That was it. Fixing in 2.0.3

On Thursday, 30 August 2012 08:06:42 UTC-5, howesc wrote:
>
> i have not run the code yet.....
>
> but upon inspection it looks like line 1619 of gluon/tools.py is 
> redundant, and because it uses an OR query it breaks on GAE.
>
> can someone confirm that:
>
>                 user = user or table_user._db(
>                     (table_user.registration_id==value)|
>                     (table_user[fieldname]==value)).select().first()
>
> can be replaced with :
>
>                 user = user or table_user._db(
>                     (table_user[fieldname]==value)).select().first()
>
> in auth.get_or_create_user() without breaking anything?
> On Thursday, August 30, 2012 3:59:39 AM UTC-7, rif wrote:
>>
>> After a succesful login from janrain running on GAE I get the following 
>> error:
>>
>> Traceback (most recent call last):
>>   File "/home/rif/Documents/webframeworks/homepage/gluon/restricted.py", 
>> line 209, in restricted
>>     exec ccode in environment
>>   File 
>> "/home/rif/Documents/webframeworks/homepage/applications/init/controllers/default.py",
>>  
>> line 105, in <module>
>>   File "/home/rif/Documents/webframeworks/homepage/gluon/globals.py", 
>> line 185, in <lambda>
>>     self._caller = lambda f: f()
>>   File 
>> "/home/rif/Documents/webframeworks/homepage/applications/init/controllers/default.py",
>>  
>> line 103, in user
>>     return dict(form=auth())
>>   File "/home/rif/Documents/webframeworks/homepage/gluon/tools.py", line 
>> 1191, in __call__
>>     return getattr(self,args[0])()
>>   File "/home/rif/Documents/webframeworks/homepage/gluon/tools.py", line 
>> 1961, in login
>>     user = self.get_or_create_user(table_user._filter_fields(cas_user))
>>   File "/home/rif/Documents/webframeworks/homepage/gluon/tools.py", line 
>> 1620, in get_or_create_user
>>     (table_user[fieldname]==value)).select().first()
>>   File "/home/rif/Documents/webframeworks/homepage/gluon/dal.py", line 
>> 8682, in select
>>     return adapter.select(self.query,fields,attributes)
>>   File "/home/rif/Documents/webframeworks/homepage/gluon/dal.py", line 
>> 4461, in select
>>     (items, tablename, fields) = self.select_raw(query,fields,attributes)
>>   File "/home/rif/Documents/webframeworks/homepage/gluon/dal.py", line 
>> 4356, in select_raw
>>     filters = self.expand(query)
>>   File "/home/rif/Documents/webframeworks/homepage/gluon/dal.py", line 
>> 4232, in expand
>>     return expression.op(expression.first, expression.second)
>>   File "/home/rif/Documents/webframeworks/homepage/gluon/dal.py", line 
>> 4087, in OR
>>     def OR(self,first,second): raise SyntaxError, "Not supported"
>> SyntaxError: Not supported
>>
>>
>> Does anybody experience the same problem?
>>
>

-- 



Reply via email to