diff --git a/tortoise/contrib/mysql/fields.py b/tortoise/contrib/mysql/fields.py index 1f5d73235..5d593e1e6 100644 --- a/tortoise/contrib/mysql/fields.py +++ b/tortoise/contrib/mysql/fields.py @@ -49,7 +49,7 @@ def to_db_value(self, value: Any, instance: "Union[Type[Model], Model]") -> Opti # If not, raise an error # This is to prevent UUIDv1 or any other version from being stored in the database if self._binary_compression: - if value is not isinstance(value, UUID): + if not isinstance(value, UUID): raise ValueError("UUIDField only accepts UUID values") return value.bytes return value and str(value)