Changeset 1322


Ignore:
Timestamp:
19 Jan 2007, 11:16:06 (18 years ago)
Author:
joachim
Message:

catch if student_object is deleted

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/Students.py

    r1321 r1322  
    903903        ipath = "%s/import/" % i_home
    904904        names = os.listdir(ipath)
    905         #import pdb;pdb.set_trace()
    906905        for name in names:
    907906            head,tail = os.path.splitext(name)
     
    910909               and name.find('imported') < 0:
    911910                self.fixEntryModeForReturning(csv_file=head)
    912 
     911    ###)
     912   
    913913    security.declareProtected(ModifyPortalContent,"fixEntryModeForReturning")###(
    914914    def fixEntryModeForReturning(self,csv_file=None):
     
    959959            if st_cat(matric_no = matric_no):
    960960                student_id = st_cat(matric_no = matric_no)[0].id
    961                 app = getattr(getattr(students_folder,student_id),'application',None)
    962                 if app is not None:
    963                     app_doc = app.getContent()
    964                 per = getattr(getattr(students_folder,student_id),'personal',None)
    965                 if per is not None:
    966                     per_doc = per.getContent()
     961                student_obj = getattr(students_folder,student_id,None)
     962                if student_obj:
     963                    app = getattr(student_obj,'application',None)
     964                    if app is not None:
     965                        app_doc = app.getContent()
     966                    per = getattr(student_obj,'personal',None)
     967                    if per is not None:
     968                        per_doc = per.getContent()
    967969            student['Mode_of_Entry'] = entry_mode = student.get('Mode of Entry').upper()
    968970            student['Permanent_Address'] = perm_address = student.get('Permanent Address')
    969             entry_mode = student['Mode of Entry']
     971            #import pdb;pdb.set_trace()
    970972            if not entry_mode:
    971973                student['Error'] = "'Mode of Entry' empty"
Note: See TracChangeset for help on using the changeset viewer.