Changeset 2313


Ignore:
Timestamp:
4 Oct 2007, 20:59:49 (17 years ago)
Author:
joachim
Message:

fix mixing of certificates and courses

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/WAeUPTool.py

    r2304 r2313  
    10031003        if getattr(self,'_v_departments',None) is None:
    10041004            res = self.portal_catalog(portal_type = "Department")
    1005             self._v_departments = {}
     1005            self._v_department_courses = {}
    10061006            for d in res:
    1007                 self._v_departments[d.getId] = getattr(d.getObject(),"courses",None)
     1007                self._v_department_courses[d.getId] = getattr(d.getObject(),"courses",None)
    10081008        did = mapping['department_code']
    1009         d = self._v_departments.get(did,None)
     1009        d = self._v_department_courses.get(did,None)
    10101010        if d is None:
    10111011            return '', "No Department with ID: %s" % did
    10121012        course_id = mapping.get('code')
    10131013        if course_id in self._v_course_list:
    1014             return '', "Duplicate Department ID: %s" % did
     1014            return '', "Duplicate Course ID: %s" % did
    10151015        c = getattr(d,course_id,None)
    10161016        if c is not None:
    1017             return '', "Duplicate Department ID: %s" % did
     1017            return '', "Duplicate Course ID: %s" % did
    10181018        try:
    10191019            d.invokeFactory('Course', course_id)
     
    10421042        if getattr(self,'_v_certificate_list',None) is None:
    10431043            self._v_certificate_list = []
    1044         if getattr(self,'_v_departments',None) is None:
     1044        if getattr(self,'_v_department_certificates',None) is None:
    10451045            res = self.portal_catalog(portal_type = "Department")
    1046             self._v_departments = {}
     1046            self._v_department_certificates = {}
    10471047            for d in res:
    1048                 self._v_departments[d.getId] = getattr(d.getObject(),"certificates",None)
     1048                self._v_department_certificates[d.getId] = getattr(d.getObject(),"certificates",None)
    10491049        did = mapping['department_code']
    1050         d = self._v_departments.get(did,None)
     1050        d = self._v_department_certificates.get(did,None)
    10511051        if d is None:
    10521052            return '', "No Department with ID: %s" % did
    10531053        certificate_id = mapping.get('code')
    10541054        if certificate_id in self._v_certificate_list:
    1055             return '', "Duplicate Department ID: %s" % did
     1055            return '', "Duplicate Certificate ID: %s" % did
    10561056        c = getattr(d,certificate_id,None)
    10571057        if c is not None:
    1058             return '', "Duplicate Department ID: %s" % did
     1058            return '', "Duplicate Certificate ID: %s" % did
    10591059        try:
    10601060            d.invokeFactory('Certificate', certificate_id)
Note: See TracChangeset for help on using the changeset viewer.