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' |