Ignore:
Timestamp:
17 Nov 2007, 18:25:29 (17 years ago)
Author:
Henrik Bettermann
Message:

allow ClearanceOfficer? to edit student subobjects

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/PatchCPSUserFolderUserFolder.py

    r2065 r2696  
    7878    ## patch to assign dynamic roles for WAeUP
    7979    while 1:
    80         #if self.isStudent():
    81         #    break
    82         # if re.match(r'\D\d\d\d\d\d\d',name):
    83         #    break
    84         #if len(name) != 7:
    85         #    break
    86         #try:
    87         #    int(name[1:])
    88         #except:
    89         #    break
     80
    9081        o = ord(name[1])
    9182        if o >= 48 and o <= 57:
     
    10394                                                   "StudentClearance",
    10495                                                   "StudentStudyLevel",
    105                                                    "StudentCourseResult",
     96                                                   "StudentPersonal",
    10697                                                  ):
    10798            break
    108 
    109         # don't test if it is not a proxy
    110         #if real_object.portal_type == real_object.meta_type:
    111         #    break
    112 
    113         # can be later simplified by replacing by students_catalog values - Henrik
    114         # getattr works always because of acquisition ?! Henrik
    115         # sc = getattr(real_object,'study_course',None)
    116         # if sc is None:
    117         #     break
    118         # sc_obj = sc.getContent()
    119         # cert_id = sc_obj.study_course
    120         # res_cert = self.portal_catalog(id = cert_id)
    121         # if len(res_cert) != 1:
    122         #     break
    123         # certificate_brain = res_cert[0]
    124         # certificate_obj = certificate_brain.getObject()
    125         # cert_path = certificate_brain.getPath().split('/')
    126         # fac_id = cert_path[-4]
    127         # dep_id = cert_path[-3]
    128         # temporary self-healing function
    129         # deprecated after reindexing the students_catalog
    13099        student_id = self.getStudentId()
    131100        res = self.students_catalog(id=student_id)
     
    133102            break
    134103        st_entry = res[0]
    135         # if st_entry.faculty != fac_id or\
    136         #    st_entry.department != dep_id or\
    137         #    st_entry.course != cert_id:
    138         #        self.students_catalog.modifyRecord(id = student_id,
    139         #                                         faculty = fac_id,
    140         #                                         department = dep_id,
    141         #                                         course = cert_id
    142         #                                         )
    143         if real_object.portal_type in ("StudentStudyLevel","StudentCourseResult"):
    144             # res_cert = self.portal_catalog(id = st_entry.course)
    145             # if len(res_cert) != 1:
    146             #     break
    147             # certificate_brain = res_cert[0]
    148             # certificate_obj = certificate_brain.getObject()
     104
     105        if real_object.portal_type in ("StudentStudyLevel"):
    149106            certificate_obj = getCertificateObject(self,st_entry)
    150107            if certificate_obj is None:
     
    157114            if real_object.portal_type == "StudentStudyLevel":
    158115                level = object.getId()
    159             elif real_object.portal_type == "StudentCourseResult":
    160                 level = object.aq_parent.getId()
    161116            context_obj = getattr(certificate_obj,level,None)
    162117            if context_obj is None:
Note: See TracChangeset for help on using the changeset viewer.