projects
/
be.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e788c9c
)
get_fallback_fullname falls back to get_fallback_username if no interesting fullname...
author
W. Trevor King
<wking@drexel.edu>
Fri, 15 Apr 2011 00:53:04 +0000
(20:53 -0400)
committer
W. Trevor King
<wking@drexel.edu>
Fri, 15 Apr 2011 00:53:04 +0000
(20:53 -0400)
libbe/ui/util/user.py
patch
|
blob
|
history
diff --git
a/libbe/ui/util/user.py
b/libbe/ui/util/user.py
index 10b2b968d4ac07d69d8b9b5f90497f2c20ac225c..5649fd955e199ec8bd557dcea07d9c9183cffa76 100644
(file)
--- 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():