You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
isinstance() arg 2 must be a type or tuple of types
Exception Value: | isinstance() arg 2 must be a type or tuple of types
Exception Location: C:\Users\mehdi\PycharmProjects\venv\lib\site-packages\enumfields\drf\fields.py, line 35, in to_internal_value
Thank you
The text was updated successfully, but these errors were encountered:
You can't pass in a list where an enum is expected. Better just add a validator function.
def validate_transfer_type(self, value: TransferType):
if value == TransferType.Wallet:
raise serializers.ValidationError("Wallet transfers not supported")
return value
Hello
Is that possible to restrict choices of enum class in serializer ?
This is my enum class:
My serializer:
I got this error when I post data:
isinstance() arg 2 must be a type or tuple of types
Exception Value: | isinstance() arg 2 must be a type or tuple of types
Exception Location: C:\Users\mehdi\PycharmProjects\venv\lib\site-packages\enumfields\drf\fields.py, line 35, in to_internal_value
Thank you
The text was updated successfully, but these errors were encountered: