Skip to content

Commit

Permalink
fix #336: detecting relationship as nullable=False
Browse files Browse the repository at this point in the history
  • Loading branch information
indiVar0508 committed Sep 4, 2022
1 parent 4f80ff6 commit 8adcc14
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/marshmallow_sqlalchemy/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def _add_relationship_kwargs(self, kwargs, prop):
nullable = True
for pair in prop.local_remote_pairs:
if not pair[0].nullable:
if prop.uselist is True:
if not self.DIRECTION_MAPPING[prop.direction.name]:
nullable = False
break
kwargs.update({"allow_none": nullable, "required": not nullable})
Expand Down

0 comments on commit 8adcc14

Please sign in to comment.