Index: WAeUP_SRP/base/skins/waeup_utilities/fixReturningSession.py
===================================================================
--- WAeUP_SRP/base/skins/waeup_utilities/fixReturningSession.py	(revision 2452)
+++ WAeUP_SRP/base/skins/waeup_utilities/fixReturningSession.py	(revision 2452)
@@ -0,0 +1,56 @@
+## Script (Python) "fixReturningSession"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=
+##title=
+##
+# $Id$
+"""
+"""
+try:
+    from Products.zdb import set_trace
+except:
+    def set_trace():
+        pass
+import logging
+logger = logging.getLogger('Skins.fixReturningSession')
+from Products.AdvancedQuery import Eq, Between, Le,In
+aq_students = context.students_catalog.evalAdvancedQuery
+
+request = context.REQUEST
+session = request.SESSION
+response = request.RESPONSE
+setheader = request.RESPONSE.setHeader
+students = context.portal_url.getPortalObject().campus.students
+#from string import Template
+def rwrite(s):
+    response.setHeader('Content-type','text/html; charset=ISO-8859-15')
+    response.write("%s<br>\n\r" % s)
+
+#logger.info('')
+
+query = Eq('review_state','returning') & In('session',('2006/2007','06'))
+brains = aq_students(query)
+total = len(brains)
+logger.info('editet %d students with session 06 and returning' % total)
+count = 0
+commit_after = 10
+
+for brain in brains:
+    count += 1
+    if count and not count % commit_after:
+        context.waeup_tool.doCommit()
+        logger.info("Committing %s transactions, total %s" % (commit_after,count))
+    try:
+        study_course_doc = getattr(getattr(students,brain.id),'study_course').getContent().edit(mapping = { "current_session": '05'})
+        study_course_doc.edit(mapping = { "current_session": '05'})
+        rwrite('found %s , %s ,%s, %s' % (brain.id,
+                                          study_course_doc.current_session,
+                                          brain.matric_no,
+                                          brain.name))
+    except:
+        rwrite('>>>> not found %s study_course' % (brain.id))
+        
