Increased Max Communications Per Hour to 1000

This commit is contained in:
Anand Doshi 2014-06-25 13:28:08 +05:30
parent 30a28c595f
commit a13db72d13

View file

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