Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: sitescripts/formmail/web/formmail.py

Issue 5920587679531008: Issue 1946 - Include form-mail sender address in message content (Closed)
Patch Set: Created April 17, 2015, 1:57 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sitescripts/formmail/template/eyeo.mail ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sitescripts/formmail/web/formmail.py
===================================================================
--- a/sitescripts/formmail/web/formmail.py
+++ b/sitescripts/formmail/web/formmail.py
@@ -16,6 +16,7 @@
# along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
import re
+import time
from urlparse import parse_qsl
from sitescripts.utils import get_config, sendMail, setupStderr
from sitescripts.web import url_handler
@@ -35,6 +36,7 @@
request_body = environ['wsgi.input'].read(request_body_length)
params = {}
+
mathias 2015/04/17 02:00:06 That accidental white-space is removed already.
for key, value in parse_qsl(request_body):
params[key] = value.decode('utf-8').strip()
@@ -50,5 +52,6 @@
if not re.match(r'^\w[\w.+!-]+@\w[\w.-]+\.[a-zA-Z]{2,6}$', params['email']):
return 'Invalid email address'
+ params['strftime'] = time.strftime
Wladimir Palant 2015/04/17 13:46:32 This seems wrong - strftime isn't a parameter, it'
mathias 2015/04/17 14:32:55 Done.
sendMail(get_config().get('formmail', 'template'), params)
return 'Message sent'
« no previous file with comments | « sitescripts/formmail/template/eyeo.mail ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld