Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
heckad committed Jun 16, 2019
1 parent eb7ed2f commit b1fcdf9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/marshmallow_sqlalchemy/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def get_instance(self, data):
:param data: Serialized data to inform lookup.
"""
if self.transient:
if self.transient or not hasattr(self.session, 'query'):
return None
props = get_primary_keys(self.opts.model)
filters = {prop.key: data.get(prop.key) for prop in props}
Expand Down

0 comments on commit b1fcdf9

Please sign in to comment.