diff options
Diffstat (limited to 'lib/sqlalchemy')
| -rw-r--r-- | lib/sqlalchemy/orm/mapper.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py index 04fc9d0ef..6bcc89b3c 100644 --- a/lib/sqlalchemy/orm/mapper.py +++ b/lib/sqlalchemy/orm/mapper.py @@ -1305,13 +1305,15 @@ class Mapper(object): if col in pks: if history.deleted: params[col._label] = prop.get_col_value(col, history.deleted[0]) + hasdata = True else: # row switch logic can reach us here # remove the pk from the update params so the update doesn't # attempt to include the pk in the update statement del params[col.key] params[col._label] = prop.get_col_value(col, history.added[0]) - hasdata = True + else: + hasdata = True elif col in pks: params[col._label] = mapper._get_state_attr_by_column(state, col) if hasdata: |
