From ffda10be23f5f00069d33b41d92cbd28a8a0c952 Mon Sep 17 00:00:00 2001 From: Euan Date: Tue, 4 Oct 2022 15:34:00 +0100 Subject: [PATCH] Updating Attachment Model with __init__ fix from #24 --- gophish/models.py | 4 ++++ 1 file changed, 4 insertions(+) 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()