Skip to content

Commit

Permalink
Merging branch 'fix_attachment_sending'.
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit fd2f58e
Author: Andrew Erickson <aerickson@gmail.com>
Date:   Sat Feb 24 01:35:01 2018 -0800

    fix amey-sam#19
  • Loading branch information
aerickson committed Apr 22, 2018
1 parent 5ae74b1 commit 6bd41c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flask_mailgun/attachment.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def attachment_decorator(f, email, filename):
"""Converts a file back into a FileStorage Object"""
with open(filename, 'r') as file:
attachment = FileStorage(stream=file,
filename=filename.encode('utf-8'))
filename=filename)
result = f(email, attachment)
return result

Expand Down Expand Up @@ -90,7 +90,7 @@ class Attachment(object):

def __init__(self, filename=None, content_type=None, data=None,
disposition=None, headers=None):
self.filename = filename.encode('utf-8')
self.filename = filename
self.content_type = content_type
self.data = data
self.disposition = disposition or 'attachment'
Expand Down

0 comments on commit 6bd41c5

Please sign in to comment.