Skip to content

Commit

Permalink
fix polymorphic_on check
Browse files Browse the repository at this point in the history
  • Loading branch information
John Lyu committed Nov 26, 2024
1 parent 4071b0f commit 48f2a88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sqlmodel/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def sqlmodel_table_construct(
# Override polymorphic_on default value
mapper = inspect(cls)
polymorphic_on = mapper.polymorphic_on
if polymorphic_on:
if polymorphic_on is not None:
polymorphic_property = mapper.get_property_by_column(polymorphic_on)
field_info = cls.model_fields.get(polymorphic_property.key)
if field_info:
Expand Down

0 comments on commit 48f2a88

Please sign in to comment.