Index: /main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/accesscodes.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/accesscodes.py	(revision 6379)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/accesscodes.py	(revision 6380)
@@ -448,54 +448,12 @@
     return code
 
-def fire_transition(access_code, arg, toward=False):
-    """Fire workflow transition for access code.
-
-    The access code instance is looked up via `access_code` (a string
-    like ``APP-1-12345678``).
-
-    `arg` tells what kind of transition to trigger. This will be a
-    transition id like ``'use'`` or ``'init'``, or some transition
-    target like :var:`waeup.sirp.accesscodes.workflow.INITIALIZED`.
-
-    If `toward` is ``False`` (the default) you have to pass a
-    transition id as `arg`, otherwise you must give a transition
-    target.
-
-    :func:`fire_transition` might raise exceptions depending on the
-    reason why the requested transition cannot be performed.
-
-    The following exceptions can occur during processing:
-
-    :exc:`KeyError`:
-      signals not existent access code, batch or site.
-
-    :exc:`ValueError`:
-      signals illegal format of `access_code` string. The regular format is
-      ``APP-N-XXXXXXXX``.
-
-    :exc:`hurry.workflow.interfaces.InvalidTransitionError`:
-      the transition requested cannot be performed because the workflow
-      rules forbid it.
-
-    :exc:`Unauthorized`:
-      the current user is not allowed to perform the requested transition.
-
-    """
+def _fire_transition(info, arg, toward=False):
     try:
-        batch_id, ac_id = access_code.rsplit('-', 1)
-    except ValueError:
-        raise ValueError(
-            'Invalid access code format: %s (use: APP-N-XXXXXXXX)' % (
-                access_code,))
-    try:
-        ac = grok.getSite()['accesscodes'][batch_id].getAccessCode(access_code)
-    except TypeError:
-        raise KeyError(
-            'No site available for looking up accesscodes')
-    info = IWorkflowInfo(ac)
-    if toward:
-        info.fireTransitionToward(arg)
-    else:
-        info.fireTransition(arg)
+        if toward:
+            info.fireTransitionToward(arg)
+        else:
+            info.fireTransition(arg)
+    except InvalidTransitionError:
+        return False
     return True
 
@@ -503,28 +461,37 @@
     """Invalidate AccessCode denoted by string ``access_code``.
 
+    The access code that belongs to the passed string must exist.
+
     Fires an appropriate transition to perform the task.
 
-    See :func:`fire_transition` for possible exceptions and their
-    meanings.
+    Returns ``True`` if the ac was invalidated, ``False`` else.
     """
-    return fire_transition(access_code, 'use')
+    ac = get_access_code(access_code)
+    info = IWorkflowInfo(ac)
+    return _fire_transition(info, 'use')
 
 def disable_accesscode(access_code):
     """Disable AccessCode denoted by string ``access_code``.
 
+    The access code that belongs to the passed string must exist.
+
     Fires an appropriate transition to perform the task.
 
-    See :func:`fire_transition` for possible exceptions and their
-    meanings.
+    Returns ``True`` if the ac was disabled, ``False`` else.
     """
-    return fire_transition(access_code, DISABLED, toward=True)
+    ac = get_access_code(access_code)
+    info = IWorkflowInfo(ac)
+    return _fire_transition(info, DISABLED, toward=True)
 
 def reenable_accesscode(access_code):
     """Reenable AccessCode denoted by string ``access_code``.
 
+    The access code that belongs to the passed string must exist.
+
     Fires an appropriate transition to perform the task.
 
-    See :func:`fire_transition` for possible exceptions and their
-    meanings.
+    Returns ``True`` if the ac was reenabled, ``False`` else.
     """
-    return fire_transition(access_code, 'reenable')
+    ac = get_access_code(access_code)
+    info = IWorkflowInfo(ac)
+    return _fire_transition(info, 'reenable')
