summaryrefslogtreecommitdiff
path: root/django/db/models/sql
diff options
context:
space:
mode:
authorJay Wineinger <jay.wineinger@gmail.com>2015-04-09 13:47:05 -0500
committerTim Graham <timograham@gmail.com>2015-04-13 12:20:41 -0400
commit496800b3bf4460e697dee942696eaee5c56f87a0 (patch)
tree47d0854e08b84843162b70308dcf22d9afd6ee82 /django/db/models/sql
parent39282704953ea74dd82963a0d983aaec87826d66 (diff)
[1.8.x] Fixed #24611 -- Fixed update() crash with related UUID pk object.
Backport of 923da0274a9a8c4ef2ac9776f71bd14628e39fc3 from master
Diffstat (limited to 'django/db/models/sql')
-rw-r--r--django/db/models/sql/compiler.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py
index 136d066ec3..f1bb10e228 100644
--- a/django/db/models/sql/compiler.py
+++ b/django/db/models/sql/compiler.py
@@ -1006,7 +1006,10 @@ class SQLUpdateCompiler(SQLCompiler):
raise FieldError("Aggregate functions are not allowed in this query")
elif hasattr(val, 'prepare_database_save'):
if field.rel:
- val = val.prepare_database_save(field)
+ val = field.get_db_prep_save(
+ val.prepare_database_save(field),
+ connection=self.connection,
+ )
else:
raise TypeError("Database is trying to update a relational field "
"of type %s with a value of type %s. Make sure "