get_fallback_fullname falls back to get_fallback_username if no interesting fullname...
authorW. Trevor King <wking@drexel.edu>
Fri, 15 Apr 2011 00:53:04 +0000 (20:53 -0400)
committerW. Trevor King <wking@drexel.edu>
Fri, 15 Apr 2011 00:53:04 +0000 (20:53 -0400)
libbe/ui/util/user.py

index 10b2b968d4ac07d69d8b9b5f90497f2c20ac225c..5649fd955e199ec8bd557dcea07d9c9183cffa76 100644 (file)
@@ -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():