Index: /WAeUP_SRP/trunk/WAeUPImport.py
===================================================================
--- /WAeUP_SRP/trunk/WAeUPImport.py	(revision 3989)
+++ /WAeUP_SRP/trunk/WAeUPImport.py	(revision 3990)
@@ -941,8 +941,13 @@
                     field_id = i.replace('student_','')
                     non_image_keys[field_id] = [key for key in schema.keys()
-                                     if schema[key].meta_type != "CPS Image Field"]        
+                                                if schema[key].meta_type != "CPS Image Field"]
+        
+        # export field names must be unique but, unfortunately, firstname, middlename and lastname are not
+        # thus we have to omit them
+        non_image_keys['clearance'].remove('firstname')
+        non_image_keys['clearance'].remove('middlename')
+        non_image_keys['clearance'].remove('lastname')
         toexport = non_image_keys
 
-        #import pdb;pdb.set_trace()   
         while True:
             if hasattr(students_folder,student_id):
@@ -961,7 +966,8 @@
                     for f in toexport_for_reimport[k]:
                         fields_for_reimport.append(f)                        
-                if True:    #not os.path.exists(export_file):        
+                if not os.path.exists(export_file):        
                     headline = ','.join(fields)
                     open(export_file,"a").write(headline +'\n')
+                if not os.path.exists(reimport_file):  
                     headline_for_reimport = ','.join(fields_for_reimport)                    
                     open(reimport_file,"a").write(headline_for_reimport +'\n')                    
@@ -990,7 +996,5 @@
                 open(reimport_file,"a").write('\n'.join(line_for_reimport) +'\n')                
                 self.course_results.exportRemoveAllCourses(student_id = student_id, export = True, remove = True)
-#                self.course_results.exportRemoveAllCourses(student_id = student_id, export = True, remove = False)
                 self.payments_catalog.exportRemoveAllPayments(student_id = student_id, export = True, remove = True)
-#                self.payments_catalog.exportRemoveAllPayments(student_id = student_id, export = True, remove = False)
                 self.waeup_tool.exportAllStudyLevels(student_id = student_id)
                 # end export
