From 91b2741f9215601ff1035f5b3a2eb76bf55bc22b Mon Sep 17 00:00:00 2001 From: KrzysztofCzapla Date: Sun, 7 Jul 2024 14:13:59 +0200 Subject: [PATCH] Type Hints and Copyright Year --- django_webhook/signals.py | 2 +- django_webhook/tasks.py | 2 +- django_webhook/validators.py | 2 +- docs/source/conf.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/django_webhook/signals.py b/django_webhook/signals.py index f8b282f..1e9bc8f 100644 --- a/django_webhook/signals.py +++ b/django_webhook/signals.py @@ -28,7 +28,7 @@ def __init__(self, signal: ModelSignal, signal_name: str, model_cls: models.Mode self.model_cls = model_cls # pylint: disable=unused-argument - def run(self, sender, created=False, instance=None, **kwargs): + def run(self, sender, created: bool = False, instance=None, **kwargs): action_type = None match self.signal_name: case "post_save" if created: diff --git a/django_webhook/tasks.py b/django_webhook/tasks.py index 6302836..e8bece3 100644 --- a/django_webhook/tasks.py +++ b/django_webhook/tasks.py @@ -21,7 +21,7 @@ retry_backoff_max=60 * 60, retry_jitter=False, ) -def fire_webhook(self, webhook_id, payload): +def fire_webhook(self, webhook_id: int, payload: dict): webhook = Webhook.objects.get(id=webhook_id) if not webhook.active: logging.warning(f"Webhook: {webhook} is inactive and I will not fire it.") diff --git a/django_webhook/validators.py b/django_webhook/validators.py index 534ad98..53176a2 100644 --- a/django_webhook/validators.py +++ b/django_webhook/validators.py @@ -2,7 +2,7 @@ from django.core.exceptions import ValidationError -def validate_topic_model(value): +def validate_topic_model(value: str): webhook_settings = getattr(settings, "DJANGO_WEBHOOK", {}) allowed_models = webhook_settings.get("MODELS", []) if not webhook_settings or not allowed_models: diff --git a/docs/source/conf.py b/docs/source/conf.py index c759b2b..6c0fcc1 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -3,7 +3,7 @@ # -- Project information project = "django-webhook" -copyright = "2023, Dani Hodovic" # pylint: disable=redefined-builtin +copyright = "2024, Dani Hodovic" # pylint: disable=redefined-builtin author = "Dani Hodovic" release = "0.0.7"