Re: [web2py] Re: Detecting changes to auth_user record of logged in user.

2016-10-07 Thread Michael Ellis
Thanks, Anthony. That works nicely. On Fri, Oct 7, 2016 at 10:32 AM Anthony wrote: > Have you tried adding: > > auth.user.update(userlevel=newlevel) > > Anthony > > > On Thursday, October 6, 2016 at 6:15:02 PM UTC-4, Michael Ellis wrote: > > > I have the following code as a json service for

[web2py] Re: Detecting changes to auth_user record of logged in user.

2016-10-07 Thread Anthony
Have you tried adding: auth.user.update(userlevel=newlevel) Anthony On Thursday, October 6, 2016 at 6:15:02 PM UTC-4, Michael Ellis wrote: > > > I have the following code as a json service for changing user privileges. > This app doesn't need the fine-grained control of Web2py RBAC so I'v

[web2py] Re: Detecting changes to auth_user record of logged in user.

2016-10-07 Thread Michael Ellis
Thanks, Marlysson. I understand why it's going wrong when the user changes their own level. My question was aimed a finding out if web2py had a convenience function to refresh auth.user from db.auth_user. Otherwise I have to use an ugly construct like: try: aid = auth.user.id # ra

[web2py] Re: Detecting changes to auth_user record of logged in user.

2016-10-07 Thread Marlysson Silva
Isn't because you are putting the level user hardcoded? There after that user change own level , the verification don't works more. 1. If you want that user name are unique mark at table the field with validator unique=True 2. The size of rows returned could be made with count() , db(query).coun