Skip to content

Commit

Permalink
Fix marshmallow 4.0.0 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
sloria committed Jan 7, 2025
1 parent c155aba commit 1221964
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Changelog

Bug fixes:

* Fix compatibility with marshmallow 3.24.0.
* Fix compatibility with marshmallow 3.24.0 and 4.0.0.

1.1.0 (2024-08-14)
++++++++++++++++++
Expand Down
2 changes: 1 addition & 1 deletion src/marshmallow_sqlalchemy/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ def _add_column_kwargs(self, kwargs, column):
if hasattr(column.type, "enums") and not kwargs.get("dump_only"):
kwargs["validate"].append(validate.OneOf(choices=column.type.enums))

if hasattr(column.type, "enum_class"):
if hasattr(column.type, "enum_class") and column.type.enum_class is not None:
kwargs["enum"] = column.type.enum_class

# Add a length validator if a max length is set on the column
Expand Down

0 comments on commit 1221964

Please sign in to comment.