No, there is no onlogout function in web2py (either in globals or in the
Auth class). Rather, the logout() function takes an "onlogout" argument,
which is a callable -- so this code:
if onlogout:
onlogout(self.user)
is inside the logout() function, and the "onlogout" referenced there is the
"onlogout" argument passed to logout() (though it defaults to
self.settings.logout_onlogout if not directly passed in to logout()).
It appears that Annet has her own "on_logout" (not "onlogout") function
defined in a module. Presumably the error is occurring because it is not
getting imported (who knows why without seeing some code).
Anthony
On Thursday, March 21, 2013 4:36:24 PM UTC-4, Richard wrote:
>
> Forgot!
>
> Sorry for the noise...
>
> So with w2p 2.3.2 get onlogout and logout_onlogout
>
> So Annet must have a mistake in his code or the on_logout change for
> onlogout I guess...
>
> Richard
>
>
> On Thu, Mar 21, 2013 at 4:16 PM, Niphlod <[email protected]
> <javascript:>>wrote:
>
>> if you search with grep you should do it recursively ....
>>
>> grep -nR 'onlogout' *
>>
>> R for recursively, n for the line number.
>>
>>
>> On Thursday, March 21, 2013 9:03:55 PM UTC+1, Richard wrote:
>>
>>> :~/version_232/web2py$ grep 'onlogout' *
>>>
>>> Return nothing!!
>>>
>>> Richard
>>>
>>>
>>> On Thu, Mar 21, 2013 at 3:43 PM, Niphlod <[email protected]> wrote:
>>>
>>>> on trunk there is such a function, however it takes only user as a
>>>> parameter
>>>>
>>>> if onlogout:
>>>> onlogout(self.user)
>>>>
>>>>
>>>> On Thursday, March 21, 2013 6:48:40 PM UTC+1, Richard wrote:
>>>>
>>>>> I don't see any decaration of on_logout in web2py 2.3.2, search the
>>>>> book for on_logout lead to nothing either...
>>>>>
>>>>> Could it be your own custom function??
>>>>>
>>>>> Richard
>>>>>
>>>>>
>>>>> On Thu, Mar 21, 2013 at 3:08 AM, Annet <[email protected]> wrote:
>>>>>
>>>>>> After upgrading to web2py version 2.4.4 this no longer works:
>>>>>>
>>>>>> auth.settings.logout_onlogout = lambda user: on_logout(auth,session)
>>>>>>
>>>>>> I get the following error:
>>>>>>
>>>>>> global name 'on_logout' is not defined.
>>>>>>
>>>>>> on_logout(auth,session) is a function in a module which clears all
>>>>>> the settings
>>>>>>
>>>>>> of the cms part of my application.
>>>>>>
>>>>>> Is there another way to call on_logout(auth,session) in web2py 2.4.4?
>>>>>>
>>>>>>
>>>>>> Kind regards,
>>>>>>
>>>>>> Annet
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>>
>>>>>> ---
>>>>>> 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 web2py+un...@**googlegroups.com.
>>>>>>
>>>>>> For more options, visit
>>>>>> https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
>>>>>> .
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>
>>>> ---
>>>> 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 web2py+un...@**googlegroups.com.
>>>> For more options, visit
>>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>>> .
>>>>
>>>>
>>>>
>>>
>>> --
>>
>> ---
>> 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] <javascript:>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>
--
---
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.