Thanks, with the last version 2.14.6-stable+timestamp.2016.05.10.00.21.47 I
don't have any errors but I have noticed that my extra_field is not being
created in my database even if I leave my DAL like this:
db = DAL('sqlite://database.db')
so I can not set the value of my extra_field
Another thing that I notice is that despite my app is asking me for my
authentication code I am not able to go back to the log in screen. What if
I have two accounts in the app and I want to login in another account? It
seems that it is not possible.
Is this behaviour expected?
Can you help me with the extra_field issue? What am I doing wrong?
And thank you for your help ;)
El domingo, 17 de julio de 2016, 12:22:21 (UTC-5), Anthony escribió:
>
> On Sunday, July 17, 2016 at 12:53:40 PM UTC-4, Bernardo Leon wrote:
>>
>> Thank you for your reply
>>
>> my web2py version is: Version 2.12.3-stable+timestamp.2015.08.19.00.18.03
>>
>
> The settings and functionality you are attempting to use were not released
> until version 2.13.1 (there was prior support for two-factor
> authentication, but it was more basic and did not include the settings in
> question).
>
>
>> And finally thanks for your observation about lambdas, If I understand
>> you I should leave it like this?:
>>
>> auth.settings.two_factor_methods = [_set_two_factor(user, auth_two_factor
>> )]
>> auth.settings.two_factor_onvalidation = [verify_otp(user, otp)]
>>
>
> No, you just need to specify the functions:
>
> auth.settings.two_factor_methods = [_set_two_factor]
> auth.settings.two_factor_onvalidation = [verify_otp]
>
> Note, that lambda x: func(x) is simply equivalent to func. The reason you
> often see a lambda function is because the function you ultimately want to
> call does not have the proper signature, so you use the lambda to generate
> a new function with the required signature, and then let the lambda call
> the ultimate function with the proper arguments. However, if the ultimate
> function already has the proper signature, there is no reason to wrap it in
> a lambda with the exact same signature. Ultimately, the callback just needs
> to be any callable object (whether a normal function, a lambda function, a
> static method of a class, or an instance of a callable class) with the
> proper signature (i.e., that accepts the arguments that the caller will
> pass to it).
>
> Anthony
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
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/d/optout.