mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #24611 -- Fixed update() crash with related UUID pk object.
This commit is contained in:
committed by
Tim Graham
parent
872eb26f54
commit
923da0274a
@@ -1012,7 +1012,10 @@ class SQLUpdateCompiler(SQLCompiler):
|
||||
raise FieldError("Aggregate functions are not allowed in this query")
|
||||
elif hasattr(val, 'prepare_database_save'):
|
||||
if field.remote_field:
|
||||
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 "
|
||||
|
||||
Reference in New Issue
Block a user