소스 검색

feat: Add Enable/Disable Webhook via Check

- Added a new field to Webhook DocType
- Modfied the webhook run logic to only fetch enabled webhooks
version-14
Hussain Nagaria 4 년 전
부모
커밋
1f70959fa1
2개의 변경된 파일11개의 추가작업 그리고 2개의 파일을 삭제
  1. +3
    -1
      frappe/integrations/doctype/webhook/__init__.py
  2. +8
    -1
      frappe/integrations/doctype/webhook/webhook.json

+ 3
- 1
frappe/integrations/doctype/webhook/__init__.py 파일 보기

@@ -21,7 +21,9 @@ def run_webhooks(doc, method):
if webhooks is None:
# query webhooks
webhooks_list = frappe.get_all('Webhook',
fields=["name", "`condition`", "webhook_docevent", "webhook_doctype"])
fields=["name", "`condition`", "webhook_docevent", "webhook_doctype"],
filters={"enabled": "1"}
)

# make webhooks map for cache
webhooks = {}


+ 8
- 1
frappe/integrations/doctype/webhook/webhook.json 파일 보기

@@ -11,6 +11,7 @@
"webhook_doctype",
"cb_doc_events",
"webhook_docevent",
"enabled",
"sb_condition",
"condition",
"cb_condition",
@@ -147,10 +148,16 @@
"fieldname": "webhook_secret",
"fieldtype": "Password",
"label": "Webhook Secret"
},
{
"default": "1",
"fieldname": "enabled",
"fieldtype": "Check",
"label": "Enabled"
}
],
"links": [],
"modified": "2020-01-13 01:53:04.459968",
"modified": "2021-04-14 05:35:28.532049",
"modified_by": "Administrator",
"module": "Integrations",
"name": "Webhook",


불러오는 중...
취소
저장