Add backward compatible order verification hash checking.
This can be enabled by specifying a `OSCAR_DEPRECATED_ORDER_VERIFY_KEY` setting, which is not set by default.
This allows projects to continue validating old order verification hashes while still changing the `SECRET_KEY`.
Refactor the shipping_status method to return a consistent last
complete status. Since dictionaries have no guaranteed order, and also
since the shipping status queryset isn’t ordered the method didn’t
always return the actual last complete status.
Conflicts:
oscar/test/newfactories.py
tests/integration/order/model_tests.py
Backported by @maikhoepfel from #1672.
Refactor the shipping_status method to return a consistent last
complete status. Since dictionaries have no guaranteed order, and also
since the shipping status queryset isn’t ordered the method didn’t
always return the actual last complete status.
Removes the auto_now_add=True. Sets now as the default, but allows changing the date_placed field explicitly if an order is updated after it has been placed.
Fixes #1529
Replace countries.json fixture by management command
I started looking at this because on the mailing list, having the UK as
only shipping country led to confusion. This is mostly due to the
shipping address form hiding the country field if there's only one
country enabled, but all the validation then requiring UK postcodes and
phone numbers.
It's bothered me for a while that we're using a fixture to populate the
countries, which is at risk of becoming stale.
pycountry offers an excellent data source for a list of countries, so I
polished an existing management command to use it to populate the
country database.
This commit has two immediate effects:
* New setups will use a more current country database
* By default, all countries will be marked as shipping countries
pycountry also ships with localised names of the countries, which should
allow us to populate the database with localised country names.
Delete unused fields on [Shipping|Payment]EventType
is_required and sequence_number are removed. That also makes the unused
get_prerequisites function obsolete.
Those fields were added with the idea that those event flows are linear,
but all implementations assume a non-linear pattern.
Hmmm, this turned out to be a monster commit. This change allows the
basket to be able to correctly calculate prices including tax.
It also requires a whole load of test changes since all baskets now
require a strategy instance to be assigned.
This allows updating code in both places, if necessary. Getting Django
1.5 support would be painful otherwise. This also removes the circular
dependency of django-oscar-testsupport on Oscar.
The requirements were merged. The imports were updated
accordingly. Unused imports in the touched files were removed. No
further changes.
Add fix for OrderDiscount model when offer deleted
The OrderDiscount did not store (a copy) of the offer
name within a separate field which causes an issue when the
offer is deleted. E.g. it breaks the order history view for
the customer because no offer data is available.
I have added a new field to OrderDiscount that is automatically
populated from the offer.name field. This works in the same way
as voucher_code does in the same model.
I also found two issues with the voucher implementation within
the same model that are fixed now.
Fixes #330
makes Oscar work with aware AND naive datetimes based on USE_TZ
* replaces all occurences of ``datetime.now()`` with
``django.utils.timezone.now()`` which returns aware or naive
datetimes based on ``USE_TZ``
* increases ``South`` version to 0.7.6 in dependencies to make
aware datetimes work in migrations.
* Oscar's sandbox is now configured to use aware timezones by
default
This is probably a breaking change for most people as the migration
history for the order app has been rewritten. It will take some
fiddling around with south to get your system back in order.
This change is required though as we need to break the links between the
apps.