From a0fa3300b77768fb478cf708fc61343f521b4646 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 22 Mar 2013 13:02:08 +0530 Subject: [PATCH] [website] [fix] signup permissions --- website/helpers/contact.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/website/helpers/contact.py b/website/helpers/contact.py index 251e1f6bb3..bf1521ee11 100644 --- a/website/helpers/contact.py +++ b/website/helpers/contact.py @@ -18,6 +18,7 @@ from __future__ import unicode_literals import webnotes from core.doctype.communication.communication import make +from webnotes.utils import now max_communications_per_hour = 300 @@ -38,7 +39,7 @@ def send_message(subject="Website Query", message="", sender="", status="Open"): # guest method, cap max writes per hour if webnotes.conn.sql("""select count(*) from `tabCommunication` - where TIMEDIFF(NOW(), modified) < '01:00:00'""")[0][0] > max_communications_per_hour: + where TIMEDIFF(%s, modified) < '01:00:00'""", now())[0][0] > max_communications_per_hour: webnotes.response["message"] = "Sorry: we believe we have received an unreasonably high number of requests of this kind. Please try later" return