From a13db72d1352235cab2a229f3ec2f08692fe1701 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 25 Jun 2014 13:28:08 +0530 Subject: [PATCH] Increased Max Communications Per Hour to 1000 --- frappe/templates/pages/contact.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frappe/templates/pages/contact.py b/frappe/templates/pages/contact.py index 1e67cff6e1..29180a2d6c 100644 --- a/frappe/templates/pages/contact.py +++ b/frappe/templates/pages/contact.py @@ -25,7 +25,7 @@ def get_context(context): return out -max_communications_per_hour = 300 +max_communications_per_hour = 1000 @frappe.whitelist(allow_guest=True) def send_message(subject="Website Query", message="", sender=""): @@ -39,7 +39,8 @@ def send_message(subject="Website Query", message="", sender=""): # guest method, cap max writes per hour if frappe.db.sql("""select count(*) from `tabCommunication` - where TIMEDIFF(%s, modified) < '01:00:00'""", now())[0][0] > max_communications_per_hour: + where `sent_or_received`="Received" + and TIMEDIFF(%s, modified) < '01:00:00'""", now())[0][0] > max_communications_per_hour: frappe.response["message"] = "Sorry: we believe we have received an unreasonably high number of requests of this kind. Please try later" return