When submitting the form with different passwords - the page reloads and
that's it. No validation, no error response.flash, nothig.
web2py version: 2.4.7-stable
On Thursday, July 25, 2013 5:44:18 PM UTC+2, Anthony wrote:
>
> What happens if the passwords are different? Which version of web2py?
>
> On Thursday, July 25, 2013 11:14:21 AM UTC-4, lesssugar wrote:
>>
>> Thanks, Anthony, I removed the if statement and it worked for
>> request_reset_password.
>>
>> However, after I click the link sent to e-mail address, the
>> reset_password form still doesn't process "New password" and "Verify
>> password" fields. The inputs can be empty, the passwords can be different -
>> no validation is performed.
>>
>> On Thursday, July 25, 2013 4:51:46 PM UTC+2, Anthony wrote:
>>>
>>>
>>> def user():
>>>>
>>>> auth.settings.formstyle = 'divs'
>>>>
>>>> if request.args(0) == 'request_reset_password':
>>>> auth.request_reset_password(next = URL('default', 'index'))
>>>>
>>>> return dict(form=auth())
>>>>
>>>
>>> Your code is creating and processing the form twice.
>>> auth.request_reset_password(...) creates and processes the form (though
>>> you aren't storing that version in a variable and passing it to the view).
>>> Then, form=auth() once again calls auth.request_reset_password(), which
>>> creates and processes the form a second time. When the form is submitted,
>>> the first call processes the form and does the validation, but the second
>>> call then creates a new form. You can simply eliminate that whole "if"
>>> segment from your code -- form=auth() will take care of everything.
>>>
>>> Anthony
>>>
>>>
--
---
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.