Index: main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/accesscodes.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/accesscodes.py	(revision 6385)
+++ main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/accesscodes.py	(revision 6386)
@@ -20,11 +20,7 @@
     grok.implements(IAccessCode)
 
-    def __init__(self, batch_serial, random_num, invalidation_date=None,
-                 student_id=None, disabled=False):
+    def __init__(self, batch_serial, random_num):
         self.batch_serial = batch_serial
         self.random_num = random_num
-        self._invalidation_date = invalidation_date
-        self.student_id = student_id
-        self._disabled = disabled
         IWorkflowInfo(self).fireTransition('init')
 
@@ -55,16 +51,4 @@
             return None
         return self.batch.cost
-
-    @property
-    def invalidation_date(self):
-        # We define this as a property to make it unwritable.
-        # This attribute should be set by the surrounding batch only.
-        return self._invalidation_date
-
-    @property
-    def disabled(self):
-        # We define this as a property to make it unwritable.
-        # This attribute should be set by the surrounding batch only.
-        return self._disabled
 
 class AccessCodeBatch(grok.Model):
@@ -86,5 +70,4 @@
         self._entries = list()
         self._acids = OIBTree()
-        self._studids = OIBTree()
         self._createEntries()
 
@@ -94,5 +77,4 @@
         for num, pin in enumerate(self._getNewRandomNum(num=self.entry_num)):
             self.addAccessCode(num, pin)
-        self._p_changed = True # XXX: most probably not needed.
         return
 
@@ -133,9 +115,4 @@
         return self._entries[self._acids[ac_id]]
 
-    def getAccessCodeForStudentId(self, stud_id):
-        """Get any AccessCode invalidated for ``stud_id`` or ``KeyError``.
-        """
-        return self._entries[self._studids[stud_id]]
-
     def addAccessCode(self, num, pin):
         """Add an access-code.
@@ -151,9 +128,4 @@
         """
         num = self._acids[ac_id]
-        ac = self.getAccessCode(ac_id)
-        ac._invalidation_date = datetime.now()
-        ac.student_id = student_id
-        if student_id is not None:
-            self._studids.update({student_id: num})
         self.invalidated_num += 1
 
@@ -168,11 +140,4 @@
         if ac._disabled == True:
             return
-        ac._disabled = True
-        old_student_id = ac.student_id
-        if old_student_id is not None:
-            del self._studids[old_student_id]
-            self._studids.update({user_id: num})
-        ac.student_id = user_id
-        ac._invalidation_date = datetime.now()
         self.disabled_num += 1
 
@@ -184,10 +149,4 @@
         """
         num = self._acids[ac_id]
-        ac = self.getAccessCode(ac_id)
-        if ac._disabled == False:
-            return
-        ac.student_id = None
-        ac._disabled = False
-        ac._invalidation_date = None
         self.disabled_num -= 1
 
@@ -234,15 +193,10 @@
             )
         writer = csv.writer(open(csv_path, 'w'), quoting=csv.QUOTE_ALL)
-        writer.writerow(['prefix', 'serial', 'ac', 'student', 'date'])
+        writer.writerow(['prefix', 'serial', 'ac', 'date'])
         writer.writerow([self.prefix, '%0.2f' % self.cost, str(self.num),
                          str(self.entry_num)])
         for value in self._entries:
-            date = ''
-            if value.invalidation_date is not None:
-                date = value.invalidation_date.strftime(
-                    '%Y-%m-%d-%H-%M-%S')
             writer.writerow([
                     self.prefix, value.batch_serial, value.representation,
-                    value.student_id, date
                     ])
         return os.path.basename(csv_path)
@@ -259,12 +213,4 @@
             except KeyError:
                 return []
-        if searchtype != 'stud_id':
-            return []
-        try:
-            entry = self.getAccessCodeForStudentId(searchterm)
-            return [entry]
-        except KeyError:
-            pass
-        return []
 
 class AccessCodeBatchContainer(grok.Container):
