From adfc96cc4b766131ea7e2317c3a8e2f84a307a68 Mon Sep 17 00:00:00 2001 From: David Winterbottom Date: Thu, 31 May 2012 17:19:11 +0100 Subject: [PATCH] Altered shipping scales to use attribute code, not name --- oscar/apps/shipping/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/oscar/apps/shipping/__init__.py b/oscar/apps/shipping/__init__.py index 5597b491f2e..07602f81d53 100644 --- a/oscar/apps/shipping/__init__.py +++ b/oscar/apps/shipping/__init__.py @@ -5,13 +5,13 @@ class Scales(object): """ For calculating the weight of a product or basket """ - def __init__(self, attribute='weight', default_weight=None): - self.attribute = attribute + def __init__(self, attribute_code='weight', default_weight=None): + self.attribute = attribute_code self.default_weight = default_weight def weigh_product(self, product): try: - attr_val = product.attribute_values.get(attribute__name=self.attribute) + attr_val = product.attribute_values.get(attribute__code=self.attribute) except ObjectDoesNotExist: if self.default_weight is None: raise ValueError("No attribute %s found for product %s" % (self.attribute, product))