Gael that's one of the bugs i've referred fo computed fields they are not 
updated in session.

Notice that you use

*auth.user*.image_user16x16

Well auth.user is nothing other than *session*.auth.user

You are also using os.path.exists wrong as you're giving it an URL.

For instance I'm sure this will work after register:


# put this function in a model
def get_img(user):
    u = db.auth_user[user.id]
    if u and u.image_user16x16:
        return URL('default', 'download', args=u.image_user16x16)
    else:
        return URL('static/images', 'favicon.png')
        
# then in a view
<img src="{{=get_img(auth.user)}}">

Note that this solution is very inefficient because you are reloading the 
user from the database, just for this image, every single time. My point is 
that this will prove to you that this is a session not being updated 
problem.


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

Reply via email to