Merge remote-tracking branch 'frappe/develop' into wip-4.1

This commit is contained in:
Anand Doshi 2014-06-25 17:07:04 +05:30
commit 4d30406f68

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