From a8501bf67c6535cfa8702699eda0ebacda33b397 Mon Sep 17 00:00:00 2001 From: vrenaville Date: Wed, 15 Feb 2017 18:50:32 +0100 Subject: [PATCH] [FIX] call method on attachement_id instead of self --- delivery_carrier_label_s3/models/shipping_label.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/delivery_carrier_label_s3/models/shipping_label.py b/delivery_carrier_label_s3/models/shipping_label.py index 6b4f272..e71fbf7 100644 --- a/delivery_carrier_label_s3/models/shipping_label.py +++ b/delivery_carrier_label_s3/models/shipping_label.py @@ -26,13 +26,13 @@ class ShippingLabel(models.Model): # we keep them in the database instead of the object storage location = self.attachment_id._storage() for attach in self: - if location == 's3' and self._store_in_db_when_s3(): + if location == 's3' and self.attachment_id._store_in_db_when_s3(): # compute the fields that depend on datas value = attach.datas bin_data = value and value.decode('base64') or '' vals = { 'file_size': len(bin_data), - 'checksum': self._compute_checksum(bin_data), + 'checksum': self.attachment_id._compute_checksum(bin_data), 'db_datas': value, # we seriously don't need index content on those fields 'index_content': False,