fixed problem with representation of user without last_name, thanks Bruno

This commit is contained in:
mdipierro
2012-12-28 01:08:33 -06:00
parent 53d251bed5
commit 902f228565
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.4.1-alpha.2+timestamp.2012.12.27.14.26.35
Version 2.4.1-alpha.2+timestamp.2012.12.28.01.07.49
+3 -3
View File
@@ -2,8 +2,7 @@
# -*- coding: utf-8 -*-
"""
This file is part of the web2py Web Framework
Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
This file is part of the web2py Web Framework Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
"""
@@ -1416,7 +1415,8 @@ class Auth(object):
def represent(id, record=None, s=settings):
try:
user = s.table_user(id)
return '%(first_name)s %(last_name)s' % user
return '%s %s' % (user.get("first_name", user.get("email")),
user.get("last_name", ''))
except:
return id
self.signature = db.Table(