auth.register() automatically does a redirect after registration, so to do 
your own redirect, you should either pass a callback as the onaccept 
argument to auth.register() or specify the callback via 
auth.settings.register_onaccept.

Also, this condition:

if (db.auth_user.user_type == 'User'):

will not do what you want. Because db.auth_user.user_type is a Field 
object, the above is simply a Query object (and since a Query object is not 
falsey in Python, the above will always evaluate to True).

Instead, assuming you use the onaccept callback, note that the registration 
Form object gets passed to the callback, so you could do:

def after_registration(form):
    if form.vars.user_type == 'User':
        redirect(...)
    etc.

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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to