Changeset 1601
- Timestamp:
- 19 Mar 2007, 23:00:22 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/Students.py
r1599 r1601 714 714 715 715 security.declareProtected(ModifyPortalContent,"fixAllNames")###( 716 def fixAllNames(self): 716 def fixAllNames(self): 717 717 "fix all students names" 718 718 import transaction … … 731 731 old_new = self.fixName(student,student_entry) 732 732 count += 1 733 response_write(response, "%d) %s: %s"% (count + total,student_entry.id,old_new))733 response_write(response,'"%d","%s","%s",' % (count + total,student_entry.id,old_new)) 734 734 if count > 2000: 735 735 transaction.commit() … … 740 740 741 741 security.declareProtected(ModifyPortalContent,"fixName")###( 742 def fixName(self,student_brain, student_entry): 742 def fixName(self,student_brain, student_entry): 743 743 "fix the name of a student" 744 744 fix = "first" … … 746 746 return "Name already fixed" 747 747 student_id = student_entry.id 748 new_student = student_entry.jamb_reg_no.startswith('6') 748 new_student = student_entry.jamb_reg_no.startswith('6') 749 749 student_obj = student_brain.getObject() 750 750 personal = getattr(student_obj,'personal',None) 751 751 invalid = '' 752 752 if personal is None: 753 return '"%s", "Returning:%s","%s"' % (invalid,student_entry.name,"not logged in")753 return '"%s","Returning","%s","%s"' % (invalid,student_entry.name,"not logged in") 754 754 per_doc = personal.getContent() 755 755 old_first = per_doc.firstname … … 784 784 if old_first: 785 785 new_last = old_first 786 786 787 787 if old_first.find('<') != -1 or\ 788 788 old_first.find('>') != -1 or\ … … 819 819 else: 820 820 text = "Returning" 821 old_new = '"%s", "%s:%s","%s"' % (invalid,text,821 old_new = '"%s","%s","%s","%s"' % (invalid,text, 822 822 student_entry.name, 823 823 name)
Note: See TracChangeset for help on using the changeset viewer.