Skip to content

Commit

Permalink
Ignore type error from mypy
Browse files Browse the repository at this point in the history
error: "type[UFMChild]" has no attribute "objects"  [attr-defined]

It's a Django model, this attribute exists...
  • Loading branch information
browniebroke committed Dec 13, 2023
1 parent a88cecf commit dcdd232
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit dcdd232

Please sign in to comment.