From daa920c8458ec13001695f36d7b8decce8c3c1ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Sun, 31 Oct 2021 17:59:55 +0100 Subject: [PATCH] Fix a couple of type issues --- src/runboat/db.py | 4 ++-- src/runboat/models.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/runboat/db.py b/src/runboat/db.py index 08bab71..999df95 100644 --- a/src/runboat/db.py +++ b/src/runboat/db.py @@ -69,7 +69,7 @@ class BuildsDb: return None return self._build_from_row(row) - def remove(self, name: str) -> None: + def remove(self, name: str) -> bool: if self.get(name) is None: return False # no change with self._con: @@ -77,7 +77,7 @@ class BuildsDb: _logger.info("Noticed removal of %s", name) return True - def add(self, build: Build) -> None: + def add(self, build: Build) -> bool: prev_build = self.get(build.name) if prev_build == build: return False # no change diff --git a/src/runboat/models.py b/src/runboat/models.py index cd0febc..6486348 100644 --- a/src/runboat/models.py +++ b/src/runboat/models.py @@ -48,8 +48,8 @@ class Build(BaseModel): def __str__(self) -> str: return f"{self.slug} ({self.name})" - def __eq__(self, other: "Build") -> bool: - if other is None: + def __eq__(self, other: object) -> bool: + if not isinstance(other, Build): return False if self.name != other.name: return False