diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-11-06 17:43:01 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-11-06 17:43:01 -0500 |
commit | 68f1bcc9da191fc72a943f2353c8d80a39bdb76a (patch) | |
tree | 887f95259ece9030288417ee61941272fca862ef /lib/sqlalchemy | |
parent | 0c19d765dce89970c0395f57f15eb5b0f09c2a29 (diff) | |
parent | 9b1777288ba9f49248485ead0f77597dacf6de2e (diff) | |
download | sqlalchemy-68f1bcc9da191fc72a943f2353c8d80a39bdb76a.tar.gz |
Merge branch 'master' into ticket_3100
Conflicts:
lib/sqlalchemy/orm/persistence.py
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r-- | lib/sqlalchemy/orm/persistence.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/sqlalchemy/orm/persistence.py b/lib/sqlalchemy/orm/persistence.py index c4a9402fb..81024c41f 100644 --- a/lib/sqlalchemy/orm/persistence.py +++ b/lib/sqlalchemy/orm/persistence.py @@ -494,12 +494,12 @@ def _collect_update_commands( params[col.key] = history.added[0] else: pk_params[col._label] = history.unchanged[0] + if pk_params[col._label] is None: + raise orm_exc.FlushError( + "Can't update table %s using NULL for primary " + "key value on column %s" % (table, col)) if params or value_params: - if None in pk_params.values(): - raise orm_exc.FlushError( - "Can't update table using NULL for primary " - "key value") params.update(pk_params) yield ( state, state_dict, params, mapper, |