Skip to content

Commit

Permalink
Revert #726 - fixes #731 (#749)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaoming authored May 3, 2024
1 parent 1de0548 commit c69dc1b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
6 changes: 5 additions & 1 deletion djmoney/models/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,11 @@ def validators(self):
def contribute_to_class(self, cls, name):
cls._meta.has_money_field = True

if not hasattr(self, "_currency_field") and not cls.__module__ == "__fake__":
# Note the discussion about whether or not the currency field should be added in migrations:
# https://github.com/django-money/django-money/issues/725
# https://github.com/django-money/django-money/pull/726
# https://github.com/django-money/django-money/issues/731
if not hasattr(self, "_currency_field"):
self.add_currency_field(cls, name)

super().contribute_to_class(cls, name)
Expand Down
12 changes: 8 additions & 4 deletions docs/changes.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
Changelog
=========

`Unreleased`_ (TBA)
`3.5`_ (TBA)
-------------------

.. important::

If you generated ``MoneyField`` migrations in the previous series 3.4.x, you may have to manually edit subsequent migrations. Please share your successful approaches in :github-issue:`731`.


**Fixed**

- (add changelog entry)
- Revert 3.4 patch, meaning that auto-generated CurrencyField is once again part of migrations :github-issue:`731` (:github-user:`benjaoming`)


**Changed**
Expand Down Expand Up @@ -817,8 +822,7 @@ wrapping with ``money_manager``.

- Initial public release

.. _Unreleased: https:///github.com/django-money/django-money/compare/3.4.1...HEAD

.. _3.5: https:///github.com/django-money/django-money/compare/3.5...HEAD
.. _3.4.1: https:///github.com/django-money/django-money/compare/3.4...3.4.1
.. _3.4: https:///github.com/django-money/django-money/compare/3.3...3.4
.. _3.3: https:///github.com/django-money/django-money/compare/3.2...3.3
Expand Down

0 comments on commit c69dc1b

Please sign in to comment.