Don't let users change their fullname to be whitespace.

(imported from commit 015fc7cbc06acd5057952a3f09a9b6d3fe68d9fd)
This commit is contained in:
Tim Abbott
2012-12-05 14:56:31 -05:00
parent a8cd5539ff
commit 41ec4d44a0
2 changed files with 7 additions and 4 deletions

View File

@@ -212,7 +212,10 @@ def compute_mit_user_fullname(email):
if proc.returncode == 0:
# Parse e.g. 'starnine:*:84233:101:Athena Consulting Exchange User,,,:/mit/starnine:/bin/bash'
# for the 4th passwd entry field, aka the person's name.
return out.split(':')[4].split(',')[0]
hesiod_name = out.split(':')[4].split(',')[0].strip()
if hesiod_name == "":
return email
return hesiod_name
elif match_user:
return match_user.group(1).lower() + "@" + match_user.group(2).upper()[1:]
except: