diff --git a/gophish/models.py b/gophish/models.py index 6e7c3f0..471adbc 100644 --- a/gophish/models.py +++ b/gophish/models.py @@ -395,6 +395,10 @@ def parse(cls, json): class Attachment(Model): _valid_properties = {'content': None, 'type': None, 'name': None} + def __init__(self, **kwargs): + for key, default in Attachment._valid_properties.items(): + setattr(self, key, kwargs.get(key, default)) + @classmethod def parse(cls, json): attachment = cls()