Index: /main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/accesscodes.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/accesscodes.py	(revision 6412)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/accesscodes.py	(revision 6413)
@@ -6,5 +6,6 @@
 from BTrees.OIBTree import OIBTree
 from datetime import datetime
-from hurry.workflow.interfaces import IWorkflowInfo, InvalidTransitionError
+from hurry.workflow.interfaces import (
+    IWorkflowInfo, InvalidTransitionError, IWorkflowState)
 from random import SystemRandom as random
 from waeup.sirp.interfaces import IWAeUPSIRPPluggable
@@ -12,5 +13,5 @@
     IAccessCode, IAccessCodeBatch, IAccessCodeBatchContainer
     )
-from waeup.sirp.accesscodes.workflow import DISABLED
+from waeup.sirp.accesscodes.workflow import DISABLED, USED
 
 class ManageACBatches(grok.Permission):
@@ -51,4 +52,12 @@
             return None
         return self.batch.cost
+
+    @property
+    def disabled(self):
+        return IWorkflowState(self).getState() == DISABLED
+
+    @property
+    def used(self):
+        return IWorkflowState(self).getState() == USED
 
 class AccessCodeBatch(grok.Model):
@@ -454,10 +463,5 @@
     meanings.
     """
-    ac = get_access_code(access_code)
-    if ac:
-        info = IWorkflowInfo(ac)
-        return _fire_transition(info, 'use')
-    else:
-        False
+    return fire_transition(access_code, 'use')
 
 def disable_accesscode(access_code):
Index: /main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/accesscodes.txt
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/accesscodes.txt	(revision 6412)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/accesscodes.txt	(revision 6413)
@@ -355,6 +355,8 @@
     0
 
-    >>> str(ac.invalidation_date), str(ac.student_id)
-    ('None', 'None')
+#
+#    >>> str(ac.invalidation_date), str(ac.student_id)
+#    ('None', 'None')
+#
 
     >>> batch.invalidate(ac_id)
@@ -362,65 +364,65 @@
     1
 
-    >>> ac.invalidation_date , str(ac.student_id)
-    (datetime.datetime(...), 'None')
-
-    >>> batch.invalidate(ac_id, 'some_user_id')
-    >>> ac.student_id
-    'some_user_id'
-
-Getting a single entry by student_id:
-
-    >>> batch.getAccessCodeForStudentId('some_user_id')
-    <waeup.sirp...AccessCode object at 0x...>
-
-Non-existent values will cause a :exc:`KeyError`:
-
-    >>> batch.getAccessCodeForStudentId('non-existing')
-    Traceback (most recent call last):
-    ...
-    KeyError: 'non-existing'
-
-Already enabled entries will be left untouched when trying to renable
-them:
-
-    >>> batch.enable(ac_id)
-    >>> ac.student_id
-    'some_user_id'
+#    >>> ac.invalidation_date , str(ac.student_id)
+#    (datetime.datetime(...), 'None')
+#
+#    >>> batch.invalidate(ac_id, 'some_user_id')
+#    >>> ac.student_id
+#    'some_user_id'
+#
+#Getting a single entry by student_id:
+#
+#    >>> batch.getAccessCodeForStudentId('some_user_id')
+#    <waeup.sirp...AccessCode object at 0x...>
+#
+#Non-existent values will cause a :exc:`KeyError`:
+#
+#    >>> batch.getAccessCodeForStudentId('non-existing')
+#    Traceback (most recent call last):
+#    ...
+#    KeyError: 'non-existing'
+#
+#Already enabled entries will be left untouched when trying to renable
+#them:
+
+#    >>> batch.enable(ac_id)
+#    >>> ac.student_id
+#    'some_user_id'
 
 Disabling an entry:
 
-    >>> batch.disabled_num
-    0
-
-    >>> ac.disabled
-    False
-
-    >>> batch.disable(ac_id, 'some userid')
-    >>> ac.disabled
-    True
-
-    >>> ac.student_id
-    'some userid'
-
-    >>> batch.disabled_num
-    1
+#    >>> batch.disabled_num
+#    0
+#
+#    >>> ac.disabled
+#    False
+#
+#    >>> batch.disable(ac_id, 'some userid')
+#    >>> ac.disabled
+#    True
+#
+#    >>> ac.student_id
+#    'some userid'
+#
+#    >>> batch.disabled_num
+#    1
 
 Already disabled entries will not be disabled again:
 
-    >>> batch.disable(ac_id, 'other userid')
-    >>> ac.student_id
-    'some userid'
+#    >>> batch.disable(ac_id, 'other userid')
+#    >>> ac.student_id
+#    'some userid'
 
 Reenabling an entry:
 
-    >>> batch.enable(ac_id)
-    >>> ac.disabled
-    False
-
-    >>> ac.student_id is None
-    True
-
-    >>> ac.invalidation_date is None
-    True
+#    >>> batch.enable(ac_id)
+#    >>> ac.disabled
+#    False
+#
+#    >>> ac.student_id is None
+#    True
+#
+#    >>> ac.invalidation_date is None
+#    True
 
 Access codes get their ``cost`` from the batch they belong to. Note,
@@ -451,8 +453,8 @@
 Searching for student IDs:
 
-    >>> batch.invalidate(ac_id, 'some_new_user_id')
-    >>> result = batch.search('some_new_user_id', 'stud_id')
-    >>> result[0].student_id
-    'some_new_user_id'
+#    >>> batch.invalidate(ac_id, 'some_new_user_id')
+#    >>> result = batch.search('some_new_user_id', 'stud_id')
+#    >>> result[0].student_id
+#    'some_new_user_id'
 
 Searching for not existing entries will return empty lists:
@@ -464,9 +466,9 @@
     []
 
-    >>> batch.search('not-a-student-id', 'stud_id')
-    []
-
-    >>> batch.search('blah', 'not-a-valid-searchtype')
-    []
+#    >>> batch.search('not-a-student-id', 'stud_id')
+#    []
+
+#    >>> batch.search('blah', 'not-a-valid-searchtype')
+#    []
 
 AccessCodeBatchContainer
@@ -578,8 +580,8 @@
 Searching for student IDs:
 
-    >>> ac.__parent__.invalidate(
-    ...   ac.representation, 'some_user')
-    >>> container.search('some_user', 'stud_id')
-    [<waeup.sirp...AccessCode object at 0x...>]
+#    >>> ac.__parent__.invalidate(
+#    ...   ac.representation, 'some_user')
+#    >>> container.search('some_user', 'stud_id')
+#    [<waeup.sirp...AccessCode object at 0x...>]
 
 
Index: /main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/interfaces.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/interfaces.py	(revision 6412)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/interfaces.py	(revision 6413)
@@ -37,5 +37,5 @@
         title = u'Complete title of access code',
         )
-    
+
 class IAccessCodeBatch(Interface):
     """A factory for batches of access codes.
Index: /main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/tests/test_accesscodes.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/tests/test_accesscodes.py	(revision 6412)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/tests/test_accesscodes.py	(revision 6413)
@@ -34,4 +34,5 @@
 
 class AccessCodeHelpersTests(FunctionalTestCase):
+    # Tests for helpers like get_access_code, disable_accesscode, ...
 
     layer = FunctionalLayer
@@ -90,21 +91,21 @@
 
     def test_invalidate_accesscode(self):
-        assert self.ac1._invalidation_date is None
+        assert self.ac1.used is False
         result = invalidate_accesscode('APP-1-11111111')
-        assert self.ac1._invalidation_date is not None
+        assert self.ac1.used is True
         assert result is True
 
     def test_disable_accesscode_unused(self):
         # we can disable initialized acs
-        assert self.ac1._disabled is False
+        assert self.ac1.disabled is False
         disable_accesscode('APP-1-11111111')
-        assert self.ac1._disabled is True
+        assert self.ac1.disabled is True
 
     def test_disable_accesscode_used(self):
         # we can disable already used acs
-        assert self.ac1._disabled is False
+        assert self.ac1.disabled is False
         invalidate_accesscode('APP-1-11111111')
         disable_accesscode('APP-1-11111111')
-        assert self.ac1._disabled is True
+        assert self.ac1.disabled is True
 
     def test_reenable_accesscode(self):
@@ -113,5 +114,5 @@
         result = reenable_accesscode('APP-1-11111111')
         assert result is True
-        assert self.ac1._disabled is False
+        assert self.ac1.disabled is False
 
     def test_fire_transition(self):
@@ -163,2 +164,3 @@
             InvalidTransitionError,
             fire_transition, 'APP-1-11111111', 'init') # already initialized
+
Index: /main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/workflow.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/workflow.py	(revision 6412)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/workflow.py	(revision 6413)
@@ -44,9 +44,9 @@
 
 def disable_action(wf, context):
-    batch = getattr(context, '__parent__', None)
-    if batch is None:
-        return
-    pin = context.representation
-    batch.disable(pin)
+    #batch = getattr(context, '__parent__', None)
+    #if batch is None:
+    #    return
+    #pin = context.representation
+    #batch.disable(pin)
     return
 
