Hi Group,
I have something like the following in a model:
def grant_permissions(form):
group_id = auth.id_group(role=request.args(0))
auth.add_membership(group_id, auth.user.id)
auth.settings.register_onaccept.append(grant_permissions)
Basically, I want to assign a user to a group upon his/her successful
registration. However, when I execute the above, I get an
AttributeError: 'NoneType' object has no attribute 'id'
. I tried to follow the code example on page 414 of the manual, but
referencing using
auth.user.id
doesn't seem to work.
So how can I get hold of the user id here for the user who has just
successfully registered? Thanks.
*
*