capitalizeformat() does not exist on Python2 and fix category variables

pull/30/head
Nicolas Bareil 2016-12-01 10:48:33 +01:00
parent d3d7bccf0b
commit e44e33fe90
1 changed files with 1 additions and 1 deletions

View File

@ -104,7 +104,7 @@ class MISPAttribute(object):
def set_all_values(self, **kwargs):
if kwargs.get('type') and kwargs.get('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
if kwargs.get('type'):
self.type = kwargs['type']