Refs -- Improved adapting DecimalField values to decimal.
@@ -1721,9 +1721,11 @@ class DecimalField(Field):
)
return decimal_value
- def get_db_prep_save(self, value, connection):
+ def get_db_prep_value(self, value, connection, prepared=False):
+ if not prepared:
+ value = self.get_prep_value(value)
return connection.ops.adapt_decimalfield_value(
- self.to_python(value), self.max_digits, self.decimal_places
+ value, self.max_digits, self.decimal_places
)
def get_prep_value(self, value):
