restore uuid check for fk

This commit is contained in:
collerek
2021-03-09 20:52:58 +01:00
parent 869f4d9d97
commit b8a85436f7

View File

@ -399,7 +399,7 @@ class ForeignKeyField(BaseField):
:return: (if needed) registered Model :return: (if needed) registered Model
:rtype: Model :rtype: Model
""" """
if cls.to.pk_type() == uuid.UUID and isinstance(value, str): if cls.to.pk_type() == uuid.UUID and isinstance(value, str): # pragma: nocover
value = uuid.UUID(value) value = uuid.UUID(value)
if not isinstance(value, cls.to.pk_type()): if not isinstance(value, cls.to.pk_type()):
raise RelationshipInstanceError( raise RelationshipInstanceError(