chg: Some more code cleanup

pull/434/head
Raphaël Vinot 2019-08-06 14:26:54 +02:00
parent 5286462361
commit 89a24d4923
1 changed files with 12 additions and 12 deletions

View File

@ -363,12 +363,12 @@ class ExpandedPyMISP(PyMISP):
if 'errors' in new_attribute:
to_return['errors'] = new_attribute['errors']
for attribute in new_attribute['Attribute']:
for new_attr in new_attribute['Attribute']:
a = MISPAttribute()
a.from_dict(**attribute)
to_return['attributes'].append(a)
return to_return
else:
if ('errors' in new_attribute and new_attribute['errors'][0] == 403
and new_attribute['errors'][1]['message'] == 'You do not have permission to do that.'):
# At this point, we assume the user tried to add an attribute on an event they don't own