Skip to content
  • Barry Warsaw's avatar
    Simplify the implementation. · d45af03c
    Barry Warsaw authored
    This merges the SubscriptionManager and UnsubscriptionManager into a
    single SubscriptionManager implementation that handles both register()
    and unregister().  This allows us to use direct class-based adaptation
    instead of the more clunky getAdapter() API.  We can also eliminate the
    funky _get_workflow() implementation detail.
    
    This has a couple of side-effects.  .confirm() must lookup the token in
    the pendings database and pull out the pending type, dispatching to the
    proper class depending on the type, or raising a LookupError if the
    token is None or there is no pendable associated with the given token.
    This feels like an acceptable trade-off.
    
    However, this *also* means that IWorkflowStateManager must lose its
    'name' argument in its methods.  That's because we won't actually know
    the name until its too late.  Honestly, the name wasn't providing much
    value anyway (it was always the subclass's name), so losing that seems
    fine too.  The complication here is that the name was a primary key in
    the 'workflowstate' table, so we need to add its removal in the database
    migration.
    d45af03c