diff --git a/src/linkahead/common/state.py b/src/linkahead/common/state.py index 42953b1ad871ed6953248d93fd17b24b2485c5b5..7f2d77067799929c1d4c84d8c285b9967eb933c3 100644 --- a/src/linkahead/common/state.py +++ b/src/linkahead/common/state.py @@ -137,7 +137,7 @@ class State: All transitions which are available from this state (read-only) """ - def __init__(self, model: str, name: str): + def __init__(self, model: Optional[str], name: Optional[str]): self.name = name self.model = model self._id: Optional[str] = None @@ -195,13 +195,7 @@ class State: ------- state : State """ - name = xml.get("name") - if name is None: - raise ValueError(f"State name is missing from xml:{str(xml)}") - model = xml.get("model") - if model is None: - raise ValueError(f"State model is missing from xml:{str(xml)}") - result = State(name=name, model=model) + result = State(name=xml.get("name"), model=xml.get("model")) result._id = xml.get("id") result._description = xml.get("description") transitions = [