You can't set it there -- if the user isn't logged in, auth.user is None. 
You have to set it at some point when you know the user is logged in (or 
set an alternative message when the user isn't logged in).

Anthony

On Wednesday, June 5, 2013 9:46:16 AM UTC-4, Rob_McC wrote:
>
>
> Thanks Anthony.
>
> in db.py
>
> This gives me an error
>
> auth.messages.reset_password = 'Hey ' +   auth.user.username +   ' Click 
> on the link http://' + request.env.http_host+URL('default','user',args=[
> 'reset_password'])+'/%(key)s to reset your password'  
>
>
>
> Errror:
> <type 'exceptions.AttributeError'>('NoneType' object has no attribute 
> 'username')
>
> and so does this:
> auth.messages.reset_password = 'Hey %s  click on the link ...' % 
> auth.user.username
>
>
> ---
> *Question:
> *
> Could the trouble be, if the user is NOT logged in, and they wouldn't be 
> if they forgot their password...
> but they did type in their email, which could give us their other 
> information, like username, etc.
>
> *
> Ref:
> Instead, you want auth.user.username (auth.user contains the db.auth_user 
> record of the **currently logged in user).*
>
> I think I'm going to set up logging - logging.conf to keep on testing 
> this, I read the 'logging.example.conf'  file.
>
>  
> mail.settings.server = 'logging'
>
> to keep testing this.
>
> --
> Thanks again.
> Rob
>
>  
>

-- 

--- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to