mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2024-11-22 07:53:19 +01:00
Don't use file paths because they don't work on S3
Fixes #721 on develop but not on master
This commit is contained in:
parent
7f27eb9428
commit
b43e60875a
@ -100,13 +100,10 @@ def send_templated_mail(template_name,
|
||||
|
||||
if files:
|
||||
for filename, filefield in files:
|
||||
mime = mimetypes.guess_type(filename)
|
||||
if mime[0] is not None and mime[0] == "text/plain":
|
||||
with open(filefield.path, 'r') as attachedfile:
|
||||
content = attachedfile.read()
|
||||
filefield.open('rb')
|
||||
content = filefield.read()
|
||||
msg.attach(filename, content)
|
||||
else:
|
||||
msg.attach_file(filefield.path)
|
||||
filefield.close()
|
||||
logger.debug('Sending email to: {!r}'.format(recipients))
|
||||
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user