diff --git a/src/linkahead/common/versioning.py b/src/linkahead/common/versioning.py index beced57a277e8bacae18b9be0bc2f5879a378b04..ea4fe3e7dcc411083bccd090e959f7b4f7b1635d 100644 --- a/src/linkahead/common/versioning.py +++ b/src/linkahead/common/versioning.py @@ -103,8 +103,8 @@ class Version(): def __init__(self, id: Optional[str] = None, date: Optional[str] = None, username: Optional[str] = None, realm: Optional[str] = None, predecessors: Optional[List[Version]] = None, successors: Optional[List[Version]] = None, - is_head: Union[bool, str] = False, - is_complete_history: Union[bool, str] = False): + is_head: Union[bool, str, None] = False, + is_complete_history: Union[bool, str, None] = False): """Typically the `predecessors` or `successors` should not "link back" to an existing Version object.""" self.id = id @@ -210,18 +210,9 @@ object.""" p) for p in xml if p.tag.lower() == "predecessor"] successors = [Version.from_xml(s) for s in xml if s.tag.lower() == "successor"] - is_head = xml.get("head") - if is_head is None: - raise ValueError(f"Version head is missing from xml:{str(xml)}") - - is_complete_history = xml.get("completeHistory") - if is_complete_history is None: - raise ValueError( - f"Version completeHistory is missing from xml:{str(xml)}") - return Version(id=xml.get("id"), date=xml.get("date"), - is_head=is_head, - is_complete_history=is_complete_history, + is_head=xml.get("head"), + is_complete_history=xml.get("completeHistory"), username=xml.get("username"), realm=xml.get("realm"), predecessors=predecessors, successors=successors)