Changeset 5063


Ignore:
Timestamp:
15 Mar 2010, 11:56:21 (15 years ago)
Author:
Henrik Bettermann
Message:

edit course result in create mode if it exists

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/WAeUPImport.py

    r5039 r5063  
    497497            for k in ('semester','credits',):
    498498                mapping[k] = getattr(self._v_courses[course_id],k)
    499             try:
    500                 self.course_results.addRecord(**mapping)
    501             except ValueError:
    502                 msg = "course result already exists: %s" % key
     499            # edit course result in create mode if it exists
     500            if self.course_results.getRecordByKey(key) is None:
     501                try:
     502                    self.course_results.addRecord(**mapping)
     503                except ValueError:
     504                    msg = "unknown error: %s" % key
     505            else:
     506                self.course_results.modifyRecord(**mapping)
    503507            break
    504508        return key,msg,mapping
Note: See TracChangeset for help on using the changeset viewer.