Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 11, 2024
1 parent de567b4 commit 63887c9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Changelog
Version 0.7.2
=============
- fix conversion of number input to DecimalField (`issue #106 <https://github.com/CarliJoy/django-pint/issues/106>`)

Version 0.7.1
=============
- fix wrong unit display in widget (`issue #43 <https://github.com/CarliJoy/django-pint/issues/43>`_)
Expand Down
2 changes: 1 addition & 1 deletion src/quantityfield/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ class PositiveIntegerQuantityField(QuantityFieldMixin, models.PositiveIntegerFie


class DecimalQuantityFormField(QuantityFormFieldMixin, forms.DecimalField):

def to_number_type(self, x: object) -> Decimal:
return Decimal(str(x))

Expand Down
1 change: 0 additions & 1 deletion tests/test_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,6 @@ def test_stores_value_in_base_units(self):
self.assertEqual(func(2), Decimal("2")) # test Int



class IntLikeFieldSaveTestBase(FieldSaveTestBase):
DEFAULT_WEIGHT_STR = "100"
DEFAULT_WEIGHT_QUANTITY_STR = "100 gram"
Expand Down

0 comments on commit 63887c9

Please sign in to comment.