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")