Clean up fullname detection for special domains.
(imported from commit 92450b37b8749d52a5322306e9475e8189ccfd89)
This commit is contained in:
		
							parent
							
								
									b183ced788
								
							
						
					
					
						commit
						f53420e347
					
				
					 1 changed files with 11 additions and 12 deletions
				
			
		|  | @ -94,18 +94,17 @@ def fetch_fullname(username): | |||
|         print >>sys.stderr, 'Error getting fullname for', username | ||||
|         traceback.print_exc() | ||||
| 
 | ||||
|     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("@1TS.ORG"): | ||||
|         return username.split("@")[0] + " (1TS)" | ||||
|     if username.upper().endswith("@DEMENTIA.ORG"): | ||||
|         return username.split("@")[0] + " (DEMENTIA)" | ||||
|     if username.upper().endswith("MIT.EDU"): | ||||
|         return username.split("@")[0] | ||||
|     domains = [ | ||||
|         ("@CS.CMU.EDU", " (CMU)"), | ||||
|         ("@ANDREW.CMU.EDU", " (CMU)"), | ||||
|         ("@IASTATE.EDU", " (IASTATE)"), | ||||
|         ("@1TS.ORG", " (1TS)"), | ||||
|         ("@DEMENTIA.ORG", " (DEMENTIA)"), | ||||
|         ("@MIT.EDU", ""), | ||||
|         ] | ||||
|     for (domain, tag) in domains: | ||||
|         if username.upper().endswith(domain): | ||||
|             return username.split("@")[0] + tag | ||||
|     return username | ||||
| 
 | ||||
| fullnames = {} | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Tim Abbott
						Tim Abbott