db.auth_user.username is a Field object in the db.auth_user table 
definition -- it does not contain the username of the currently logged in 
user. Instead, you want auth.user.username (auth.user contains the 
db.auth_user record of the currently logged in user).

Anthony

On Wednesday, June 5, 2013 8:19:06 AM UTC-4, Rob_McC wrote:
>
> Thanks Massimo...
>
> Something still not right...
>
> I try simply this: in db.py
>
> auth.messages.reset_password = 'Hey ' + db.auth_user.username +  '  click 
> on the link ...'
>
>
> and email inbox shows
>
> Hey auth_user.username click on the link ...
>
> Also..
>
> Or replace
>
> db.auth_user.username
>
>
> with
>
> db.auth_user.username.name
>
> Didn't work for me either.
>
> Any tips would be appreciated.
>
> I tried many times, and now gmail thinks my message is spam....
>
> Rob
>
>
>
>
>
>
>
>
> On Tuesday, June 4, 2013 11:21:01 PM UTC-4, Massimo Di Pierro wrote:
>>
>> Or replace
>>
>> db.auth_user.username
>>
>> with
>>
>> db.auth_user.username.name
>>
>> On Tuesday, 4 June 2013 22:01:28 UTC-5, Rob_McC wrote:
>>>
>>> Hey..
>>>
>>> I want to customize the reset-password message, to in include the 
>>> username,
>>>
>>>
>>> I get this error:
>>>
>>> cannot concatenate 'str' and 'Field' objects
>>>
>>> What am I missing?
>>>
>>>
>>>
>>> File: db.py
>>>
>>>
>>> auth.messages.reset_password = 'Hey ' + db.auth_user.username +  ' 
>>>  click on the link http://'+request.env.http_host+URL('default','user',
>>> args=['reset_password'])+'/%(key)s to reset your password'
>>>
>>>
>>> Thanks 
>>> 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