Skip to content

Commit

Permalink
✅ fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
CMHopeSunshine committed May 16, 2024
1 parent 5bae827 commit 37a9441
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cherry/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -810,17 +810,17 @@ def _pre_resolve_relationship_field(cls):
elif isinstance(field_info, ForeignKeyField):
raise FieldTypeError(
f"Model {cls}'s ForeignKeyField {field_name} "
"types must be a subclass of Cherry.Model",
f"types must be a subclass of Cherry.Model, not {type(type_)}",
)
elif isinstance(field_info, ManyToManyField):
raise FieldTypeError(
f"Model {cls}'s ManyToManyField {field_name} types"
" must be a sequence type of Cherry.Model",
f" must be a sequence type of Cherry.Model, not {type(type_)}",
)
if not check_issubclass(type_, Model):
raise FieldTypeError(
f"Model {cls}'s RelationshipField {field_name} types"
" must be a subclass of Cherry.Model",
f" must be a subclass of Cherry.Model, not {type(type_)}",
)
field_info.nullable = is_nullable
field_info.related_model = type_
Expand Down

0 comments on commit 37a9441

Please sign in to comment.