Skip to content

Commit

Permalink
Port forms-builder fix for large file uploads.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenmcd committed Mar 29, 2014
1 parent e7a6f7a commit 9527662
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mezzanine/forms/page_processors.py
Expand Up @@ -33,6 +33,10 @@ def form_processor(request, page):
url = page.get_absolute_url() + "?sent=1"
if is_spam(request, form, url):
return redirect(url)
attachments = []
for f in form.files.values():
f.seek(0)
attachments.append((f.name, f.read()))
entry = form.save()
subject = page.form.email_subject
if not subject:
Expand All @@ -55,10 +59,6 @@ def form_processor(request, page):
headers = {'Reply-To': email_to}
email_copies = split_addresses(page.form.email_copies)
if email_copies:
attachments = []
for f in form.files.values():
f.seek(0)
attachments.append((f.name, f.read()))
send_mail_template(subject, "email/form_response_copies",
email_from, email_copies, context,
attachments=attachments, headers=headers)
Expand Down

0 comments on commit 9527662

Please sign in to comment.