code: def validate_state_transition(self, user, start_state, end_state, **kwargs):
          
          if start_state == end_state:
              raise Return(True)
  
          transitions = self.state_transitions.get(start_state, [])
  
          approved_transitions = []
          can_approve = yield self.can_approve(user, **kwargs)
          if can_approve:
              approved_transitions = self.approval_state_transitions.get(start_state, [])
  
          if end_state not in transitions and end_state not in approved_transitions:
              raise Return(False)
  
          raise Return(True)
docs: Validate whether user can transition resource from start state to end state
          :param user
          :param start_state
          :param end_state
          :return: bool