fix(comments): fixed outdated comments logic broken by latest changes

This commit is contained in:
RhodeCode Admin 2023-12-01 20:52:11 +01:00
parent 7f75e4e70e
commit 83486ed285

View file

@ -3851,19 +3851,11 @@ class ChangesetComment(Base, BaseModel):
def immutable(self):
return self.immutable_state == self.OP_IMMUTABLE
def outdated_at_version(self, version):
def outdated_at_version(self, version: int) -> bool:
"""
Checks if comment is outdated for given pull request version
"""
# If version is None, return False as the current version cannot be less than None
if version is None:
return False
# Ensure that the version is an integer to prevent TypeError on comparison
if not isinstance(version, int):
raise ValueError("The provided version must be an integer.")
def version_check():
return self.pull_request_version_id and self.pull_request_version_id != version