This

form = auth.profile()
form.process(onvalidation=reauthenticate_user)

is wrong because auth.profile() already calls process inside. Instead you 
should do:

auth.settings.profile_onvalidation.append(reauthenticate_user)
form = auth.profile()

On Thursday, 5 September 2013 17:42:18 UTC-5, Mark Li wrote:
>
> Currently I am creating a form with auth.profile()
>
> I have an onvalidation method to perform some extra checks.
>
> form = auth.profile()
> if form.process(onvalidation=reauthenticate_user).accepted:
>
>     response.flash = "Changes Saved"
> elif form.errors:
>
>     response.flash = "Errors found
>
>
>
> This prevented auth.user object from being updated, which auth.profile() 
> usually takes care of.
>
> I also tried it with the following:
>
> form = auth.profile()
> form.process(onvalidation=reauthenticate_user)
>
>
>
> but the default accepts method that usually updates auth.user doesn't work 
> either
>
> For now, I've just added the following to the accepted method:
> auth.user.update(db.auth_user._filter_fields(form.vars)) 
>
> But I'm interested in knowing if it's possible to specify an onvalidation 
> method for auth.profile(), while still using the built-in accepts method.
>

-- 

--- 
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to