Fix URL character validation in dashboard PageUpdateForm.
Also fix the max_length on the url field. The underlying model field has
a max_length of 100, so it is invalid to have a larger value here.
DRY out dashboard page update/create views.
Refactor tests - perform tests of form logic directly rather than indirectly through view code.
Fixes #2559.
With this change phone numbers (any qty) can be added as `ModelForm`
property `phone_numbers_fields` - dict where "keys" are names of
phone numbers fields and "values" are attributes of fields.
* `PhoneNumberMixin` clightly reworked and moved
from `oscar.views.generic` to `oscar.forms.mixins`
* Couple tests added (based on previous tests)
Fix site notifications generated by send_product_alerts.
Notification subjects have a max length of 255 characters, which can easily be exceeded by long product names. Change the alert logic to provide a short notification subject and put the longer content in the notification body.
This patch also modifies the notification utils to make it obvious that the positional argument is a notification subject, not a body.
* flesh-out initial opaque data-model
refactors the basket line consumption into a facade object.
the goals is accomodating combitions of various offers on the same basket-lines,
while remaining backward compatible with the current single offer per line
policy.
* add docstrings
* add exclusive flag to conditionaloffer model and continue refactoring
* test new offer consumption on basket view
* cleanups
* fix exclusivity
* code style
* add cast to pacify tests
* spelling
* add some documentation to the release notes
* move documentation to new 1.6 release docs
Don't allow multiple unconfirmed product alerts for anonymous users.
This is to prevent the possibility of spamming a user by generating lots of alert confirmation emails for product alerts.
Also allow unconfirmed alerts to be cancelled - we send a cancellation link in the confirmation email, so we should let users cancel an alert if they don't want to confirm it.
Fixes #2401.
Add datetime attribute to ProductAttributeValue as asked for in issue #2389 (#2393)
* Add datetime attribute to ProductAttributeValue as asked for in issue #2389
Used widget DateTimePickerInput from oscar.forms.widgets
* Fix migration catalogue 0012 (was error with python3)
* Add tests for ProductAttributeValue
Fix handling of free products when calculating basket totals in Python 3.
In Python 2, adding None to the basket total worked, but in Python 3 this raises a TypeError. This fixes the handling of totals to distinguish between a zero price and a non-existent price.
Refactor Benefit clean methods and add tests for all of them.
- Refactor clean methods to return all validation errors, rather than just the first one we found.
- Fix clean method type errors in Python 3
- Add tests for the clean methods for all benefit types.
Fix logic for checking whether an offer is active based on date.
- If start_datetime is null, then the offer has no start date.
- If end_datetime is null, then the offer never expires.
Use the ActiveOfferManager in Applicator.get_site_offers instead of
reimplementing the same logic there.
Fixes #2344.
Switch to using Django's password validation framework in Django >=1.9
Django 1.9 introduced the AUTH_PASSWORD_VALIDATORS setting which allows for
more flexible password validation. Switch to using that when it is available,
with a fallback to Oscar's previous behaviour in Django 1.8 or when this
setting is empty.
Cleanup unused benefits and conditions after conditional offer removal.
Now after ConditionalOffer deleted will be deleted related Benefits and Conditions models (through post_delete signal) if they are no longer used by other offers (with exception of custom benefits/conditions). Plus some small changes related to PEP8 and typos.