I think it is best to set the settings in the model where you define_tables() but your code should work. Anthony, is right, show us the full index()
On Wednesday, 6 June 2018 23:40:48 UTC+2, b.l. masters wrote: > > I feel like I must be missing some basic step here. So would I put these > settings like this, in default.py?: > > def user(): > auth.settings.registration_requires_verification = False > auth.settings.registration_requires_approval = False > auth.settings.login_after_registration = True > auth.settings.login_next = URL('site', 'accounts', 'index') > auth.settings.register_next = URL('site', 'accounts', 'index') > return dict(form=auth()) > > Because, I tried this, and its not applying the settings when I use > auth.register() either. Sorry, but an example of exactly where these > settings should go so that these settings will work when I use > auth.register() would be super helpful. As they don't seem to work in all > of the places I would have tried. > > Thanks > > On Wednesday, June 6, 2018 at 5:28:55 PM UTC-4, Anthony wrote: >> >> On Wednesday, June 6, 2018 at 4:48:48 PM UTC-4, b.l. masters wrote: >>> >>> So by "auth.register() itself handles the form processing, automatic >>> login, and redirect": Do you mean, that these functions are applied in the >>> pre-processing (as you also mention), so I can't alter them?? Or can the: >>> >>> auth.settings.login_after_registration, >>> auth.settings.registration_requires_verification, etc. >>> >>> work on the auth.register()? >>> >> >> The /default/user action calls auth(), which itself ultimately calls >> auth.register(). So, using auth.register() directly is the same as going to >> the /default/user action. Any settings applied (such as the two above) will >> be in effect in either case. >> >> auth.register() creates a SQLFORM and calls .process() on that form. So >> you cannot then also call .process() on that same form. You need to remove >> that from your code. Also, auth.register() automatically creates the user >> group and does the redirect. >> >> Anthony >> > -- 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.