Changeset 928 for WAeUP_SRP


Ignore:
Timestamp:
23 Nov 2006, 17:03:16 (18 years ago)
Author:
joachim
Message:

check for dupplicate courses during import

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/Academics.py

    r720 r928  
    234234                continue
    235235            course_id = course.get('code')
     236            if course_id in course_list:
     237                msg = "Dupplicate Course %(code)s" % course
     238                logger.info(msg)
     239                no_import.write(msg)
     240                no_import.write(format % course + "\n")
     241                continue
    236242            cf = dept.courses
    237243            c = getattr(cf,course_id,None)
     
    239245                logger.info('Creating Course %(code)s  %(title)s in Department %(department_code)s' % course)
    240246                cf.invokeFactory('Course', course_id)
     247                course_list.append(course_id)
    241248                c = getattr(cf,course_id)
    242249            c.getContent().edit(mapping=course)
Note: See TracChangeset for help on using the changeset viewer.