Merge remote-tracking branch 'frappe/develop' into wip-4.1
This commit is contained in:
commit
4d30406f68
1 changed files with 3 additions and 2 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue