Remove unneeded variable
This commit is contained in:
parent
5a4e56056f
commit
07aeea44c2
1 changed files with 1 additions and 3 deletions
|
|
@ -38,14 +38,12 @@ def add_webhook(reader: Reader, webhook_name: str, webhook_url: str):
|
||||||
|
|
||||||
|
|
||||||
def remove_webhook(reader: Reader, webhook_url: str):
|
def remove_webhook(reader: Reader, webhook_url: str):
|
||||||
clean_webhook_url: str = webhook_url.strip()
|
|
||||||
|
|
||||||
# Get current webhooks from the database if they exist otherwise use an empty list.
|
# Get current webhooks from the database if they exist otherwise use an empty list.
|
||||||
webhooks: list[dict[str, str]] = list_webhooks(reader)
|
webhooks: list[dict[str, str]] = list_webhooks(reader)
|
||||||
|
|
||||||
# Only add the webhook if it doesn't already exist.
|
# Only add the webhook if it doesn't already exist.
|
||||||
for webhook in webhooks:
|
for webhook in webhooks:
|
||||||
if webhook["url"] in clean_webhook_url:
|
if webhook["url"] in webhook_url.strip():
|
||||||
webhooks.remove(webhook)
|
webhooks.remove(webhook)
|
||||||
|
|
||||||
# Check if it has been removed.
|
# Check if it has been removed.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue