Index: /main/waeup.kofa/trunk/src/waeup/kofa/students/catalog.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/students/catalog.py	(revision 9169)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/students/catalog.py	(revision 9170)
@@ -63,10 +63,13 @@
         self.state = context.state
         self.translated_state = context.translated_state
-        try:
-            current_level = course_levels.getTerm(
-                context['studycourse'].current_level).title
-        except LookupError:
-            current_level = None
-        self.current_level = current_level
+        #try:
+        #    current_level = course_levels.getTerm(
+        #        context['studycourse'].current_level).title
+        #except LookupError:
+        #    current_level = None
+        #self.current_level = current_level
+
+        self.current_level = context['studycourse'].current_level
+
         try:
             current_session = academic_sessions_vocab.getTerm(
Index: /main/waeup.kofa/trunk/src/waeup/kofa/university/course.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/university/course.py	(revision 9169)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/university/course.py	(revision 9170)
@@ -21,6 +21,9 @@
 from zope.catalog.interfaces import ICatalog
 from zope.interface import implementedBy
+from zope.schema import getFields
+from zope.intid.interfaces import IIntIds
 from zope.component import getUtility
 from zope.component.interfaces import IFactory, ComponentLookupError
+from waeup.kofa.interfaces import IKofaPluggable
 from waeup.kofa.university.interfaces import ICourse, ICourseAdd
 
@@ -37,5 +40,7 @@
                  credits=0,
                  passmark=40,
-                 semester=1, **kw):
+                 semester=1,
+                 former_course=False,
+                 **kw):
         super(Course, self).__init__(**kw)
         self.title = title
@@ -44,4 +49,5 @@
         self.passmark = passmark
         self.semester = semester
+        self.former_course = former_course
 
     def longtitle(self):
@@ -83,2 +89,39 @@
         cert._p_changed = True
     return
+
+class CoursesPlugin(grok.GlobalUtility):
+    """A plugin that updates courses.
+    """
+
+    grok.implements(IKofaPluggable)
+    grok.name('courses')
+
+    deprecated_attributes = []
+
+    def setup(self, site, name, logger):
+        return
+
+    def update(self, site, name, logger):
+        cat = getUtility(ICatalog, name='courses_catalog')
+        results = cat.apply({'code':(None,None)})
+        uidutil = getUtility(IIntIds, context=cat)
+        items = getFields(ICourse).items()
+        for r in results:
+            o = uidutil.getObject(r)
+            # Add new attributes
+            for i in items:
+                if not hasattr(o,i[0]):
+                    setattr(o,i[0],i[1].missing_value)
+                    logger.info(
+                        'CoursesPlugin: %s attribute %s added.' % (
+                        o.code,i[0]))
+            # Remove deprecated attributes
+            for i in self.deprecated_attributes:
+                try:
+                    delattr(o,i)
+                    logger.info(
+                        'CoursesPlugin: %s attribute %s deleted.' % (
+                        o.code,i))
+                except AttributeError:
+                    pass
+        return
Index: /main/waeup.kofa/trunk/src/waeup/kofa/university/interfaces.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/university/interfaces.py	(revision 9169)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/university/interfaces.py	(revision 9170)
@@ -168,4 +168,13 @@
         )
 
+    former_course = schema.Bool(
+        title = _(u'Former Course'),
+        description = _(
+            u'If this attribute is being set all certificate courses '
+            'referring to this course will be automatically deleted.'),
+        required = False,
+        default = False,
+        )
+
     def longtitle():
         """
Index: /main/waeup.kofa/trunk/src/waeup/kofa/utils/batching.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/utils/batching.py	(revision 9169)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/utils/batching.py	(revision 9170)
@@ -361,5 +361,5 @@
                     self.writeFailedRow(
                         failed_writer, string_row,
-                        "Cannot remove: no such entry.")
+                        "Cannot remove: no such entry")
                     continue
                 self.delEntry(row, site)
