Skip to content

Commit 1a7f07a

Browse files
committed
fix(compiler): fix potential bug in UpdateCompiler
1 parent 4f30ac6 commit 1a7f07a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

clickhouse_backend/models/sql/compiler.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def as_sql(self):
201201
)
202202
elif hasattr(val, "prepare_database_save"):
203203
if field.remote_field:
204-
val = field.get_db_prep_save(
204+
val = field.get_db_prep_value(
205205
val.prepare_database_save(field),
206206
connection=self.connection,
207207
)
@@ -212,7 +212,8 @@ def as_sql(self):
212212
% (field, val, field.__class__.__name__)
213213
)
214214
else:
215-
val = field.get_db_prep_save(val, connection=self.connection)
215+
# update params are formatted into query string.
216+
val = field.get_db_prep_value(val, connection=self.connection)
216217

217218
# Getting the placeholder for the field.
218219
if hasattr(field, "get_placeholder"):

0 commit comments

Comments
 (0)