mirror of https://github.com/MISP/PyMISP
capitalizeformat() does not exist on Python2 and fix category variables
parent
d3d7bccf0b
commit
e44e33fe90
|
@ -104,7 +104,7 @@ class MISPAttribute(object):
|
||||||
def set_all_values(self, **kwargs):
|
def set_all_values(self, **kwargs):
|
||||||
if kwargs.get('type') and kwargs.get('category'):
|
if kwargs.get('type') and kwargs.get('category'):
|
||||||
if kwargs['type'] not in self.category_type_mapping[kwargs['category']]:
|
if kwargs['type'] not in self.category_type_mapping[kwargs['category']]:
|
||||||
raise NewAttributeError('{} and {} is an invalid combinaison, type for this category has to be in {}'.capitalizeformat(self.type, self.category, (', '.join(self.category_type_mapping[self.category]))))
|
raise NewAttributeError('{} and {} is an invalid combinaison, type for this category has to be in {}'.format(self.type, self.category, (', '.join(self.category_type_mapping[kwargs['category']]))))
|
||||||
# Required
|
# Required
|
||||||
if kwargs.get('type'):
|
if kwargs.get('type'):
|
||||||
self.type = kwargs['type']
|
self.type = kwargs['type']
|
||||||
|
|
Loading…
Reference in New Issue