From dcdd232424f28a61b16a30b7f0e732d1b4c3a9ec Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Wed, 13 Dec 2023 09:46:25 +0000 Subject: [PATCH] Ignore type error from mypy error: "type[UFMChild]" has no attribute "objects" [attr-defined] It's a Django model, this attribute exists... --- tests/serializers.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/serializers.py b/tests/serializers.py index 811e035..3c5e46f 100644 --- a/tests/serializers.py +++ b/tests/serializers.py @@ -202,9 +202,10 @@ class Meta: class UFMChildSerializerForValidatorMessage(UniqueFieldsMixin, serializers.ModelSerializer): field = serializers.CharField(validators=[ - UniqueValidator(queryset=models.UFMChild.objects.all(), - message=UNIQUE_ERROR_MESSAGE - ) + UniqueValidator( + queryset=models.UFMChild.objects.all(), # type: ignore[attr-defined] + message=UNIQUE_ERROR_MESSAGE, + ) ]) class Meta: