From 902f228565edbc72b634e99b8b83fc5a5bba5f96 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Fri, 28 Dec 2012 01:08:33 -0600 Subject: [PATCH] fixed problem with representation of user without last_name, thanks Bruno --- VERSION | 2 +- gluon/tools.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index f78ed260..95a7a744 100644 --- a/VERSION +++ b/VERSION @@ -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 diff --git a/gluon/tools.py b/gluon/tools.py index fd0f098a..4644cc61 100644 --- a/gluon/tools.py +++ b/gluon/tools.py @@ -2,8 +2,7 @@ # -*- coding: utf-8 -*- """ -This file is part of the web2py Web Framework -Copyrighted by Massimo Di Pierro +This file is part of the web2py Web Framework Copyrighted by Massimo Di Pierro 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(