Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Register FORMS_DISABLE_SEND_FROM_EMAIL_FIELD in mezzanine.conf.

  • Loading branch information...
commit 13b7194987e4ae4741ba50f0408e4dfb91b15b72 1 parent f9a5974
Stephen McDonald authored January 06, 2012
9  mezzanine/conf/defaults.py
@@ -205,6 +205,15 @@
205 205
 )
206 206
 
207 207
 register_setting(
  208
+    name="FORMS_DISABLE_SEND_FROM_EMAIL_FIELD",
  209
+    description=_("If ``True``, emails sent to extra recipients for form "
  210
+        "submissions won't be sent from an address taken from one of the "
  211
+        "form's email fields."),
  212
+    editable=False,
  213
+    default=False,
  214
+)
  215
+
  216
+register_setting(
208 217
     name="FORMS_FIELD_MAX_LENGTH",
209 218
     description=_("Max length allowed for field values in the forms app."),
210 219
     editable=False,
6  mezzanine/forms/page_processors.py
@@ -35,12 +35,12 @@ def form_processor(request, page):
35 35
         if email_to and page.form.send_email:
36 36
             msg = EmailMessage(subject, body, email_from, [email_to])
37 37
             msg.send()
38  
-        if not getattr(settings.FORMS_DISABLE_SEND_FROM_EMAIL_FIELD, False):
  38
+        if not settings.FORMS_DISABLE_SEND_FROM_EMAIL_FIELD:
39 39
             # Send from the email entered,
40 40
             # unless FORMS_DISABLE_SEND_FROM_EMAIL_FIELD is True.
41 41
             email_from = email_to or email_from
42  
-        email_copies = [e.strip() for e in page.form.email_copies.split(",")
43  
-            if e.strip()]
  42
+        email_copies = page.form.email_copies.split(",")
  43
+        email_copies = [e.strip() for e in email_copies if e.strip()]
44 44
         if email_copies:
45 45
             msg = EmailMessage(subject, body, email_from, email_copies)
46 46
             for f in form.files.values():

0 notes on commit 13b7194

Please sign in to comment.
Something went wrong with that request. Please try again.