From 309964c84c2a9fcf23998beb3d2648555d6fba5f Mon Sep 17 00:00:00 2001 From: Mark Walker Date: Tue, 2 Jul 2024 10:07:37 +0100 Subject: [PATCH 1/2] fix: Ruff workflow --- .github/workflows/ruff.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml index a85c6f5f2..c77ef9140 100644 --- a/.github/workflows/ruff.yml +++ b/.github/workflows/ruff.yml @@ -22,4 +22,4 @@ jobs: - run: python -Im pip install --user ruff - name: Run Ruff - run: ruff --output-format=github . + run: ruff check --output-format=github . From 912dc86c1b5c97d0f0e6cff0865127acee450b65 Mon Sep 17 00:00:00 2001 From: Mark Walker Date: Tue, 2 Jul 2024 10:19:02 +0100 Subject: [PATCH 2/2] fix: Ruff fixes --- core/models/event.py | 4 +--- djangogirls/utils/sanitize.py | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/core/models/event.py b/core/models/event.py index 3cf5eabb5..0a98b2619 100644 --- a/core/models/event.py +++ b/core/models/event.py @@ -115,9 +115,7 @@ def ical_uid(self): def date_is_approximate(self): if not self.date: return True - if not all((self.date.year, self.date.month, self.date.day)): - return True - return False + return not all((self.date.year, self.date.month, self.date.day)) @property def lnglat(self): diff --git a/djangogirls/utils/sanitize.py b/djangogirls/utils/sanitize.py index 109629de7..ad6562116 100644 --- a/djangogirls/utils/sanitize.py +++ b/djangogirls/utils/sanitize.py @@ -11,9 +11,9 @@ def sanitize(value, output_type): """ # pylint: disable=no-else-return - if output_type == bool: + if output_type is bool: return sanitize_bool(value) - elif output_type == int: + elif output_type is int: return sanitize_int(value) # pylint: enable=no-else-return # unrecognised/unsupported output_type. just return what we got..