Skip to content

Commit

Permalink
Updating Attachment Model with __init__
Browse files Browse the repository at this point in the history
fix from gophish#24
  • Loading branch information
EuanKerr authored Oct 4, 2022
1 parent 1a8a6be commit ffda10b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gophish/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit ffda10b

Please sign in to comment.