Get carrier context: get cost_method when have carrier

This commit is contained in:
resteve 2014-04-25 11:28:49 +02:00
parent 09a0e36694
commit 2ec2f062ac
1 changed files with 1 additions and 1 deletions

View File

@ -63,7 +63,7 @@ class Sale:
def _get_carrier_context(self):
context = super(Sale, self)._get_carrier_context()
if self.carrier.carrier_cost_method == 'grid':
if self.carrier and self.carrier.carrier_cost_method == 'grid':
context['shipment_zip'] = (self.shipment_address
and self.shipment_address.zip or None)
return context