Render promotions within content block of layout.html
Promotions were omitted from the main layout block (accidentally I
imagine). I think they used to be there - perhaps a template refactor
stripped them out.
This commit reinstates them so pages that use the default layout
template (like flatpages) can have promotions added to them.
Recent commit regarding null=True on CharFields (44da815) broke
importing the offers fixtures because of a field being null.
The Travis builds did not fail because loaddata wrongly returns an exit
code of 0: https://code.djangoproject.com/ticket/20538
Split payment models into abstract and concrete versions
Hattip to @BuddhaOhneHals for doing this in the first place.
Unfortunately, I couldn't (be bothered to) merge the original commit as
the merge conflicts were too painful to resolve - simpler to just
reapply the same change myself.
Fixes #466
null=True is only useful for a few edge cases where one wants to
separate between '' and None. If null=True was found, it was removed.
If blank=True was not set already, it was set instead. If default=None
was set, it was removed (defaulting to '').
I then grepped the source code for tests 'is None' and 'is not None',
and checked the instances where default=None was set.
Fixes #584
The BasketView template used to show always show a section for the saved
basket. As the saved basket is empty more often than not and it's not
obvious from that point how to get items into the saved basket, that is
probably confusing.
The change in 72c3d7cf broke validation for group products as it tested
if the user could add the initial product to his/her basket. This fails
for group products as they have no stock.
When a user ordered a product and it was deleted afterwards, there were
two problems with her order history view.
It wasn't working because the 'Add review' button relied on
line.product.slug, which threw a NoReverseMatch error.
The 'Reorder' button threw an error message '%title is no longer
available for purchase'. That was changed to '%title is no longer
available' to clarify.
Additionally, both the review and reorder buttons are now only displayed
when the product is still in our database - saving the user from a
disappointing click.
- browse.html used to check products.count to decide whether do display
any products. The most common case of products.count returning >0
would mean an additional query to then fetch the products.
- Product reviews were part of the product base query set. As the
product rating has been denormalised onto AbstractProduct, that's
unnecessary.
Avoids lookups like that are essentially
"product.stockrecord.product" by passing both the stock record and
product where appropriate.
move product arg to the end, to not break existing code, if any
Before this commit, all products of Lines in the saved basket would be
checked for availability on each action, even on unrelated actions
like deleting a line or moving another line to the basket. This was
mentioned in issue #666.
This changeset only does the availability check if the Line is to be
moved back to the basket.
I refactored the fields list for SavedLineForm from blacklisting six
fields to whitelisting two field for clarity reasons.
Fixes #666