From 6c5129e7908d064f100caced40a9855cc50507d3 Mon Sep 17 00:00:00 2001 From: Johanna England Date: Wed, 27 Nov 2024 10:16:42 +0100 Subject: [PATCH] Use isinstance for checking that settings are dict --- src/argus/notificationprofile/serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/argus/notificationprofile/serializers.py b/src/argus/notificationprofile/serializers.py index c2c1b66e6..9ad95377f 100644 --- a/src/argus/notificationprofile/serializers.py +++ b/src/argus/notificationprofile/serializers.py @@ -141,7 +141,7 @@ def validate(self, attrs: dict): if self.instance and "media" in attrs.keys() and not attrs["media"].slug == self.instance.media.slug: raise serializers.ValidationError("Media cannot be updated, only settings.") if "settings" in attrs.keys(): - if type(attrs["settings"]) != dict: + if not isinstance(attrs["settings"], dict): raise serializers.ValidationError("Settings has to be a dictionary.") if self.instance: medium = api_safely_get_medium_object(self.instance.media.slug)