Sometimes we load states from the database. In order to avoid loading
        an arbitrary class, we list here the state classes that are allowed.

def _make_allowed_states(self) -> Iterator[Text]:
        """
        Sometimes we load states from the database. In order to avoid loading
        an arbitrary class, we list here the state classes that are allowed.
        """

        for trans in self.transitions:
            yield trans.dest.name()

            if trans.origin:
                yield trans.origin.name()