mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2024-11-22 16:03: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:
|
if files:
|
||||||
for filename, filefield in files:
|
for filename, filefield in files:
|
||||||
mime = mimetypes.guess_type(filename)
|
filefield.open('rb')
|
||||||
if mime[0] is not None and mime[0] == "text/plain":
|
content = filefield.read()
|
||||||
with open(filefield.path, 'r') as attachedfile:
|
|
||||||
content = attachedfile.read()
|
|
||||||
msg.attach(filename, content)
|
msg.attach(filename, content)
|
||||||
else:
|
filefield.close()
|
||||||
msg.attach_file(filefield.path)
|
|
||||||
logger.debug('Sending email to: {!r}'.format(recipients))
|
logger.debug('Sending email to: {!r}'.format(recipients))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user