feat: update n8n webhook handling
All checks were successful
Validate PR Title / validate (pull_request) Successful in 4s
CI / ci (pull_request) Successful in 1m9s

This commit is contained in:
Luke Tainton
2025-08-04 08:54:14 +01:00
parent c234cb043d
commit 1052b47625
13 changed files with 20 additions and 10 deletions

View File

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

View File

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