Skip to content

Commit 2c64a0c

Browse files
committed
fix model_fields.test_jsonfield.TestSaveLoad.test_bulk_update_custom_get_prep_value
django/django@9525135
1 parent a19e2e4 commit 2c64a0c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

django_mongodb_backend/expressions.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,12 @@ def when(self, compiler, connection):
186186

187187
def value(self, compiler, connection): # noqa: ARG001
188188
value = self.value
189+
output_field = self._output_field_or_none
190+
if output_field is not None:
191+
if self.for_save:
192+
value = output_field.get_db_prep_save(value, connection=connection)
193+
else:
194+
value = output_field.get_db_prep_value(value, connection=connection)
189195
if isinstance(value, int):
190196
# Wrap numbers in $literal to prevent ambiguity when Value appears in
191197
# $project.

0 commit comments

Comments
 (0)