Allow file attachments in storages other than local files (eg S3). Fixes GH-249.

This commit is contained in:
Ross Poulton
2014-09-02 18:36:00 +10:00
parent 1aed98463a
commit 4c901880bc
3 changed files with 10 additions and 10 deletions

View File

@ -268,7 +268,7 @@ class TicketForm(CustomFieldMixin, forms.Form):
# Only files smaller than 512kb (or as defined in
# settings.MAX_EMAIL_ATTACHMENT_SIZE) are sent via email.
try:
files.append(a.file.path)
files.append([a.filename, a.file])
except NotImplementedError:
pass
@ -441,7 +441,7 @@ class PublicTicketForm(CustomFieldMixin, forms.Form):
if file.size < getattr(settings, 'MAX_EMAIL_ATTACHMENT_SIZE', 512000):
# Only files smaller than 512kb (or as defined in
# settings.MAX_EMAIL_ATTACHMENT_SIZE) are sent via email.
files.append(a.file.path)
files.append([a.filename, a.file])
context = safe_template_context(t)