code: def _state_invalid(self):
          
          for statemanager, conditions in self.statetransition.transitions.items():
              current_state = getattr(self.obj, statemanager.propname)
              if conditions['from'] is None:
                  state_valid = True
              else:
                  mstate = conditions['from'].get(current_state)
                  state_valid = mstate and mstate(self.obj)
              if state_valid and conditions['if']:
                  state_valid = all(v(self.obj) for v in conditions['if'])
              if not state_valid:
                  return statemanager, current_state, statemanager.lenum.get(current_state)
docs: If the state is invalid for the transition, return details on what didn't match
  
          :return: Tuple of (state manager, current state, label for current state)