Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Made ADDRESS_MODEL not required anymore.

  • Loading branch information...
commit 128402033fa23c94ef1d13d91804a780172d6a02 1 parent d698f1d
Mathijs de Bruin dokterbob authored
17 shopkit/shipping/basemodels.py
@@ -163,13 +163,16 @@ def update_shipping(self):
163 163 item.update_shipping()
164 164
165 165
166   -class AddressedShippedItemBase(models.Model):
167   - class Meta:
168   - abstract = True
169   -
170   - shipping_address = models.ForeignKey(ADDRESS_MODEL, null=True, blank=True,
171   - related_name='shippable%(class)s_set')
172   - """ Shipping address for this order"""
  166 +if ADDRESS_MODEL:
  167 + class AddressedShippedItemBase(models.Model):
  168 + class Meta:
  169 + abstract = True
  170 +
  171 + shipping_address = models.ForeignKey(ADDRESS_MODEL, null=True, blank=True,
  172 + related_name='shippable%(class)s_set')
  173 + """ Shipping address for this order"""
  174 +else:
  175 + logger.warn('ADDRESS_MODEL not defined, not using shipping_address in shipping module.')
173 176
174 177
175 178 class ShippedOrderItemBase(ShippedItemBase):
2  shopkit/shipping/settings.py
@@ -18,6 +18,6 @@
18 18
19 19 from django.conf import settings
20 20
21   -ADDRESS_MODEL = getattr(settings, 'SHOPKIT_SHIPPING_ADDRESS_MODEL')
  21 +ADDRESS_MODEL = getattr(settings, 'SHOPKIT_SHIPPING_ADDRESS_MODEL', None)
22 22 """ Shipping address model """
23 23

0 comments on commit 1284020

Please sign in to comment.
Something went wrong with that request. Please try again.