From 8ccaa99de2396902e26a19a04f2dbe135b4289b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20H=C3=B8rl=C3=BCck=20Berg?= <36937807+henrikhorluck@users.noreply.github.com> Date: Thu, 12 Oct 2023 23:16:41 +0200 Subject: [PATCH] Fix flake8 lints --- apps/marks/models.py | 2 +- apps/sso/serializers.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/marks/models.py b/apps/marks/models.py index 19494cc43..b5d83797d 100644 --- a/apps/marks/models.py +++ b/apps/marks/models.py @@ -197,7 +197,7 @@ def _get_with_duration_and_vacation(added_date=timezone.now()): if added_date < mark_change_date: duration = 30 - if type(added_date) == datetime: + if isinstance(added_date, datetime): added_date = added_date.date() # Add the duration diff --git a/apps/sso/serializers.py b/apps/sso/serializers.py index 731cf82b9..4b6f64e26 100644 --- a/apps/sso/serializers.py +++ b/apps/sso/serializers.py @@ -23,9 +23,9 @@ def to_representation(self, value): return value.split() def to_internal_value(self, data): - if type(data) == list: + if isinstance(data, list): return " ".join(data) - elif type(data) == str: + elif isinstance(data, str): return data.replace("\r\n", " ") else: raise ValidationError("Incorrect format")