support for users with a period in their names
authorScott Baker <bakers@cs.arizona.edu>
Fri, 14 Nov 2008 18:31:14 +0000 (18:31 +0000)
committerScott Baker <bakers@cs.arizona.edu>
Fri, 14 Nov 2008 18:31:14 +0000 (18:31 +0000)
plc/import.py

index 122c76f..ce43c44 100644 (file)
@@ -104,10 +104,16 @@ def get_pl_pubkey(key_id):
     else:
         return None
 
-def import_person(parent_hrn, person):
+def person_to_hrn(parent_hrn, person):
     personname = person['last_name'] + "_" + person['first_name']
-
+    personname = personname.replace(" ", "_")
+    personname = personname.replace(".", "_")
     hrn = parent_hrn + "." + personname
+    return hrn
+
+def import_person(parent_hrn, person):
+    hrn = person_to_hrn(parent_hrn, person)
+
     report.trace("Import: importing person " + hrn)
 
     table = get_auth_table(parent_hrn)