From 8c0c5d1255319e5766d6e1b404b4a0c4dfb6c1f3 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 14 Apr 2011 20:53:04 -0400 Subject: get_fallback_fullname falls back to get_fallback_username if no interesting fullname is set. --- libbe/ui/util/user.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libbe') diff --git a/libbe/ui/util/user.py b/libbe/ui/util/user.py index 10b2b96..5649fd9 100644 --- a/libbe/ui/util/user.py +++ b/libbe/ui/util/user.py @@ -64,10 +64,11 @@ def get_fallback_fullname(): if os.environ.has_key(env): name = os.environ[env] break - if name is None and pwd: + if pwd and not name: pw_ent = pwd.getpwuid(os.getuid()) name = pw_ent.pw_gecos.split(',', 1)[0] - assert name is not None + if not name: + name = get_fallback_username() return name def get_fallback_email(): -- cgit