From 5e6e282b9bc32c9a508db0d32a79d5dbbda8b61f Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 24 Aug 2023 11:27:20 +0100 Subject: [PATCH] Check that ValueFlows attachments have names --- shares.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/shares.py b/shares.py index 1c8b08d51..ee874171c 100644 --- a/shares.py +++ b/shares.py @@ -2228,10 +2228,13 @@ def _is_valueflows_attachment(attach_item: {}) -> bool: """Returns true if the given item is a ValueFlows entry within the actor attachment list """ - if 'rel' in attach_item and 'href' in attach_item: + if 'rel' in attach_item and \ + 'href' in attach_item and \ + 'name' in attach_item: if isinstance(attach_item['rel'], list) and \ + isinstance(attach_item['name'], str) and \ isinstance(attach_item['href'], str): - if len(attach_item['rel']) == 2: + if len(attach_item['rel']) == 2 and len(attach_item['name'] > 1): if attach_item['rel'][0] == 'payment' and \ attach_item['rel'][1].endswith('/valueflows/Proposal'): return True