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.
Setting a default shipping or billing address used to mean finding the
checkbox in the edit view. It is now possible directly from the
AddressListView via a dropdown.
If an address is a default address for either, it is also marked as such
in the AddressListView.
This commit removes the checkboxes for is_default_for_(billing|shipping)
from the UserAddressForm, hence also hiding them in the address edit views
in the checkout app.
OSCAR_REQUIRED_ADDRESS_FIELDS allows setting which fields are required.
The use case is that post codes are expected to be required, but many
countries don't actually use them.