Created
March 15, 2017 17:21
-
-
Save dianaclarke/e79481904a15566af3db956f42de5982 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/sqlalchemy/orm/persistence.py b/lib/sqlalchemy/orm/persistence.py | |
index 88b9944..8f7dfaf 100644 | |
--- a/lib/sqlalchemy/orm/persistence.py | |
+++ b/lib/sqlalchemy/orm/persistence.py | |
@@ -710,6 +710,12 @@ def _emit_update_statements(base_mapper, uowtransaction, | |
for state, state_dict, params, mapper, \ | |
connection, value_params, has_all_defaults, \ | |
has_all_pks in records: | |
+ | |
+ msg = "Instance does not contain a non-NULL version value" | |
+ if mapper.version_id_col is not None and \ | |
+ mapper.version_id_col.key not in params: | |
+ raise orm_exc.FlushError(msg) | |
+ | |
c = cached_connections[connection].\ | |
execute(statement, params) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment