Index: /WAeUP_SRP/base/skins/waeup_utilities/ti_507_resolve.py
===================================================================
--- /WAeUP_SRP/base/skins/waeup_utilities/ti_507_resolve.py	(revision 3375)
+++ /WAeUP_SRP/base/skins/waeup_utilities/ti_507_resolve.py	(revision 3376)
@@ -22,5 +22,4 @@
     return
 
-
 import logging
 import DateTime
@@ -38,8 +37,8 @@
 count = 0
 found = 0
-commit_after = 100000
+commit_after = 1000
 certificates = context.getCertificatesDict()
 students = context.students_catalog()
-wrong = []
+wrong = {}
 missing_courses = []
 wrong_modes = {}
@@ -64,9 +63,29 @@
             w_count += 1
             wrong_modes[(current_mode,study_mode)] = w_count
-            wrong += student.id,
-    if wrong and not (len(wrong) % commit_after):
-        logger.info('found %d wrong of %d' % (len(wrong),count))
+            d = {}
+            d['student_id'] = student.id
+            d['current_mode'] = study_mode
+            d['current_mode_old'] = current_mode
+            wrong[student.id] = d
+    # if wrong and not (len(wrong) % commit_after):
+    #     logger.info('found %d wrong of %d' % (len(wrong),count))
 for k,v in wrong_modes.items():
     logger.info('wrong mode %s counted %d' % (k,v))
 logger.info('missing courses %s (%d counted)' % (', '.join(missing_courses),len(students_with_missing_courses)))
 logger.info('found %d wrong of %d' % (len(wrong),count))
+count = 0
+for student_id,d in wrong.items():
+    #set_trace()
+    try:
+        getattr(getattr(students_folder,student_id),'study_course').getContent().edit(mapping=d)
+        failed = False
+    except:
+        failed = True
+    if failed:
+        logger.info("%(student_id)s change failed")
+    else:
+        logger.info("%(student_id)s changed current_mode from %(current_mode_old)s to %(current_mode)s" % d)
+    if count and not count % commit_after:
+        context.waeup_tool.doCommit()
+        logger.info("committing %d of total %d" % (commit_after,count))
+    count += 1
