Changeset 720 for WAeUP_SRP


Ignore:
Timestamp:
18 Oct 2006, 08:22:37 (18 years ago)
Author:
joachim
Message:

fixed dupplicate certificate id for certificate courses import

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/Academics.py

    r719 r720  
    358358        certs = {}
    359359        for f in l:
    360             certs[f.id] = f.getObject()
     360            ca,ac,fa,depid,co,code = f.relative_path.split('/')
     361            pid = "%(depid)s_%(code)s" % vars()
     362            certs[pid] = f.getObject()
    361363        for cert_course in cert_courses:
    362364            processing = "processing %s" % format
     
    365367            course_code = cert_course.get('code')
    366368            code = cert_course.get('certificate_code')
    367             if not code in certs.keys():
     369            pid = "%(depid)s_%(code)s" % vars()
     370            if not pid in certs.keys():
    368371                em = 'CertCode %(certificate_code)s for %(code)s not found\n' % cert_course
    369372                logger.info(em)
     
    371374                no_import_list.append(format % cert_course + ',"Certificate"\n')
    372375                continue
    373             certificate = certs[code]
     376            certificate = certs[pid]
    374377            certificate_code = certificate.getId()
    375378            if course_code not in c_ids:
Note: See TracChangeset for help on using the changeset viewer.