From 01f4aabe6310f66cc81105e81ffdd1121d357a48 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Fri, 12 Oct 2012 11:45:41 -0400 Subject: [PATCH] Rework algorithm for computing fullnames for crossrealm zephyr users. (imported from commit 5cc49e2565e8a10d8f34ac16886e1603f190fece) --- api/zephyr_mirror.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/api/zephyr_mirror.py b/api/zephyr_mirror.py index 8b25ac14a4..7148ecb280 100644 --- a/api/zephyr_mirror.py +++ b/api/zephyr_mirror.py @@ -94,7 +94,19 @@ def fetch_fullname(username): print >>sys.stderr, 'Error getting fullname for', username traceback.print_exc() - return username.title().replace('@', ' at ').replace('.', ' dot ') + if username.upper().endswith("@CS.CMU.EDU"): + return username.split("@")[0] + " (CMU)" + if username.upper().endswith("@ANDREW.CMU.EDU"): + return username.split("@")[0] + " (CMU)" + if username.upper().endswith("@IASTATE.EDU"): + return username.split("@")[0] + " (IASTATE)" + if username.upper().endswith("@LTS.ORG"): + return username.split("@")[0] + " (LTS)" + if username.upper().endswith("@DEMENTIA.ORG"): + return username.split("@")[0] + " (DEMENTIA)" + if username.upper().endswith("MIT.EDU"): + return username.split("@")[0] + return username fullnames = {} def username_to_fullname(username):