Skip to content

Commit

Permalink
Merge 443acd9 into 9f453e9
Browse files Browse the repository at this point in the history
  • Loading branch information
neok0 committed Feb 16, 2018
2 parents 9f453e9 + 443acd9 commit 323679c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pymisp/mispevent.py
Expand Up @@ -569,13 +569,14 @@ def add_attribute_tag(self, tag, attribute_identifier):
:attribute_identifier: can be an ID, UUID, or the value.
'''
attributes = []
for a in self.attributes:
for a in self.attributes + [attribute for o in self.objects for attribute in o.attributes]:
if ((hasattr(a, 'id') and a.id == attribute_identifier) or
(hasattr(a, 'uuid') and a.uuid == attribute_identifier) or
(hasattr(a, 'value') and attribute_identifier == a.value or
attribute_identifier in a.value.split('|'))):
a.add_tag(tag)
attributes.append(a)

if not attributes:
raise Exception('No attribute with identifier {} found.'.format(attribute_identifier))
self.edited = True
Expand Down

0 comments on commit 323679c

Please sign in to comment.