Adjust form templatetag to handle missing field var
When a non-existant field gets passed, the templatetag was raising an
unseemly AttributeError. This change checks to see if the passed var is
actually a form field to avoid said error.
Add another missing migration for UppercaseCharField
Unfortunately, abstract versions of addresses are located in the address
app, but then used in e.g. order/models.py. That's why I missed the
migration for this one.
Oh well, all good things come in three's!
The old one was too identical to the product URL scheme and caused
issue #765. There really isn't a good way to keep them in the same
"namespace", hence all category browsing will happen under
/catalogue/category now.
- Non-field errors render in separate alert blocks (including the
exclamation icon)
- We also show a generic "there are errors" block at the top of an
invalid form.
Bad index in `last_line = covered_lines[-1][1]` (previously [-1][0])
caused rounding error. When you have 3 products for £7 and benefit 3
things per £20, each product would get discount £0.33 which doesn't sum
up to £1. The existing code handles this but bad indexing makes it fail.
A test case reproducing the issue was added.
Fixes #742
This change adds a uniqueness constraint on user addresses to prevent
duplicates. A few changes follow:
- The user address forms in account and checkout are modified to take a
user as a constructor arg so uniqueness can be checked.
- The assignment of a user when creating a new address has been moved
into the form.
It's possible that a user could select an address to ship to but then
delete it before checkout is complete. This change raises an
UnableToPlaceOrder exception in such circumstances.
Fix variable name mismatch in "Basket total now" message
The message context includes the variable include_buttons, but the
template checks for presence of show_buttons. This led to the buttons
never being displayed.
- Expand width of address block
- Wrap edit user address form in "well"
- Add extra blocks to preview template, splitting out shipping address,
contact number, notes and method.