ahh thank you for this post !! i found my solution also. never knew def can 
be put inside model. i did like this for the redirect url 
because auth.settings.login_next=URL('addarticle') wont work. dont know 
why. 

def redirect_login(form):
    if auth.has_membership(user_id=auth.user.id,role='members'):
        redirect(URL('Kelab_Taha'))
                
    elif auth.has_membership(user_id=auth.user.id,role='admin'):
        redirect(URL('addarticle'))
    
    else:
        redirect(URL('index'))
        
auth.settings.login_onaccept.append(redirect_login)

>
>

-- 

--- 
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/groups/opt_out.


Reply via email to