On Sunday, November 27, 2016 at 3:04:57 PM UTC-5, Joe Lwe wrote:
>
> Hi Kumar,
> am at the wall with the same problem you hard, am not having success
>

First, please always explain exactly what problem you are having -- what do 
you expect, and what is happening instead? If you get an error, show the 
traceback. It can be very difficult to diagnose vague problems like "not 
having success".
 

> default.py
> def __add_user_membership(form):
>     group_id = auth.id_group(role=form.vars.account_type)
>

auth.id_group takes the *name* (not id) of a role stored in the 
db.auth_group table and returns the id of that role. It appears you are 
instead passing in the *id *of a record from your own db.account_type table 
-- it is not clear what you are expecting to get back.
 

>     user_id = form.vars.id
>     auth.add_membership(group_id, user_id)
>

As you are not using the db.auth_group table to assign roles, 
auth.add_membership will be of no use to you.

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.

Reply via email to