Browse Source

[FIX] bug of compute internal_hash

pull/376/head
Mourad Elhadj Mimoune 9 years ago
parent
commit
27e077f6ed
  1. 2
      attachment_metadata/models/attachment.py

2
attachment_metadata/models/attachment.py

@ -36,7 +36,7 @@ class IrAttachmentMetadata(models.Model):
for attachment in self: for attachment in self:
if attachment.datas: if attachment.datas:
attachment.internal_hash = hashlib.md5( attachment.internal_hash = hashlib.md5(
b64decode(self.datas)).hexdigest()
b64decode(attachment.datas)).hexdigest()
if attachment.external_hash and\ if attachment.external_hash and\
attachment.internal_hash != attachment.external_hash: attachment.internal_hash != attachment.external_hash:
raise UserError( raise UserError(

Loading…
Cancel
Save