Skip to content

Commit

Permalink
Bugfix - excluded primary key caused a KeyError
Browse files Browse the repository at this point in the history
  • Loading branch information
mlenzen committed Feb 6, 2020
1 parent 18a8a8e commit 098fc12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wtforms_sqlalchemy/orm.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def model_fields(model, db_session=None, only=None, exclude=None,

if only:
order = list(only)
properties = {key: properties[key] for key in only}
properties = {key: properties[key] for key in only if key in properties}
elif exclude:
properties = {key: prop for key, prop in properties.items() if key not in exclude}

Expand Down

0 comments on commit 098fc12

Please sign in to comment.