feat: update n8n webhook handling
This commit is contained in:
@@ -42,9 +42,14 @@ class Config:
|
||||
return os.environ["ADMIN_EMAIL"].split(",")
|
||||
|
||||
@property
|
||||
def n8n_webhook_url(self) -> str:
|
||||
"""Returns the n8n webhook URL."""
|
||||
return os.environ["N8N_WEBHOOK_URL"]
|
||||
def n8n_get_webhook_url(self) -> str:
|
||||
"""Returns the n8n GET webhook URL."""
|
||||
return os.environ["N8N_GET_WEBHOOK_URL"]
|
||||
|
||||
@property
|
||||
def n8n_post_webhook_url(self) -> str:
|
||||
"""Returns the n8n POST webhook URL."""
|
||||
return os.environ["N8N_POST_WEBHOOK_URL"]
|
||||
|
||||
@property
|
||||
def approved_users(self) -> list:
|
||||
|
@@ -16,7 +16,7 @@ def __n8n_post(data: dict) -> bool:
|
||||
"""
|
||||
headers: dict = {"Content-Type": "application/json"}
|
||||
resp: requests.Response = requests.post(
|
||||
url=config.n8n_webhook_url,
|
||||
url=config.n8n_post_webhook_url,
|
||||
headers=headers,
|
||||
json=data,
|
||||
timeout=10,
|
||||
@@ -58,7 +58,7 @@ def get_tasks(requestor) -> bool:
|
||||
"""
|
||||
headers: dict = {"Content-Type": "application/json"}
|
||||
resp: requests.Response = requests.get(
|
||||
url=config.n8n_webhook_url,
|
||||
url=config.n8n_get_webhook_url,
|
||||
headers=headers,
|
||||
timeout=10,
|
||||
verify=True,
|
||||
|
Reference in New Issue
Block a user