Changeset 1076


Ignore:
Timestamp:
18 Dec 2006, 17:01:42 (18 years ago)
Author:
joachim
Message:

fix for modified departments and faculties

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/PatchCPSUserFolderUserFolder.py

    r1066 r1076  
    7171    ## patch to assign dynamic roles for WAeUP
    7272    while 1:
    73         #import pdb; pdb.set_trace()
    7473        if callable(real_object) and hasattr(real_object,'im_self'):
    7574            real_object = real_object.im_self
     
    8079        if sc is None:
    8180            break
    82         res = self.students_catalog(id=self.getStudentId())
     81        student_id = self.getStudentId()
     82        res = self.students_catalog(id=student_id)
    8383        if len(res) != 1:
    8484            break
     
    8686        res = self.portal_catalog(portal_type="Department",id=dep_id)
    8787        if len(res) != 1:
    88             break
     88            #import pdb; pdb.set_trace()
     89            res_sc = self.portal_catalog(portal_type="Certificate",
     90                                         id = sc.getContent().study_course)
     91            if len(res_sc) != 1:
     92                break
     93            cert_path = res_sc[0].getPath().split('/')
     94            fac_id = cert_path[-4]
     95            dep_id = cert_path[-3]
     96            res = self.portal_catalog(portal_type="Department",id=dep_id)
     97            if len(res) != 1:
     98                break
     99            self.students_catalog.modifyRecord(id = student_id,
     100                                                  faculty = fac_id,
     101                                                  department = dep_id,
     102                                                  )
    89103        dynamic_roles = self.getRolesInContext(res[0].getObject())
    90104        for dr in ('ClearanceOfficer','CourseAdviser', 'SectionManager'):
Note: See TracChangeset for help on using the changeset viewer.