better version :

def __add_user_membership(form):
        group_id = auth.id_group(role=form.vars.user_type)
        user_id = form.vars.id
        auth.add_membership(group.id,user_id)

On Thu, 22 Dec 2011 01:52:50 +0530, Anthony <abasta...@gmail.com> wrote:

You can use an auth.settings.register_onaccept function, which could use
auth.add_membership() to add the appropriate membership for the new user.

Anthony

On Wednesday, December 21, 2011 3:00:20 PM UTC-5, Chandra wrote:


I'm attempting to add a user to a group , depending on the role he chose
 from a dropdown list.

for e.g., In the register form user is presented an option of choosing
user type 1. individual 2. organisation

how do i add the user to the appropriate group depending on his selection?

(i went through the group archives, and one solution was to use
request.args, but i want to use single register link)



Reply via email to