Yes, got it now. Actually, it will happen in a controller as well if you run that code at the top level rather than inside a function (will also happen if you run the code in a view). It seems to be a general problem with saving dictionaries to the session, and it is triggered not only by iterating over the dictionary but even by getting a single value from the dictionary.
I'm not sure what a good solution would be, as it seems to be a problem with cPickle. We could switch to a lower protocol or to pickle, but that would slow things down. Anthony On Monday, March 14, 2016 at 8:29:16 PM UTC-4, Alex wrote: > > If the code (e.g. iterating user_groups) is in a controller everything is > fine and the session file is not written. But just put this code > > if auth.user_id: > for role in auth.user_groups.itervalues(): > continue > > > in db.py of the welcome app after auth.define_tables and the session file > will be overridden on every request. So the difference is if the session is > changed (or the pickled session to be more concrete) in a model file or a > controller. > > I've tested this with the welcome app, I can upload it if needed but I > guess it's not really necessary. > -- 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.