The problem is that auth stores itself in session (session.auth = auth) Now sure why this worked before.
Massimo On Friday, 19 October 2012 14:02:35 UTC-5, Marin Pranjić wrote: > > I have virtual and lazy fields on auth_user table and I store them in auth > on each request. > > Lazy field is the the issue because I store lambda in auth. > I just tried to remove it and it works without it. > > So, I have: > if auth.user: > auth.user.something = lambda: ... > > And this fails. > > I can live without it but I thought it was safe because auth is filtering > the fields, right? > > Dana petak, 19. listopada 2012. 20:52:15 UTC+2, korisnik Massimo Di Pierro > napisao je: >> >> Do you have a lazy virtual fields in a table and then store records with >> the lazy virtual field in the session? >> >> On Friday, 19 October 2012 13:26:09 UTC-5, Marin Pranjić wrote: >>> >>> Traceback (most recent call last): >>> File "/home/www-data/test-web2py/gluon/main.py", line 561, in wsgibase >>> session._try_store_on_disk(request, response) >>> File "/home/www-data/test-web2py/gluon/globals.py", line 703, in >>> _try_store_on_disk >>> cPickle.dump(dict(self), response.session_file) >>> File "/usr/lib/python2.7/copy_reg.py", line 70, in _reduce_ex >>> raise TypeError, "can't pickle %s objects" % base.__name__ >>> TypeError: can't pickle function objects >>> >>> >>> It happens with trunk and 2.1.1 but not with 2.0.9 >>> >>> Marin >>> >>> --