From c9046460099af795c4910c2bf6067703965b32b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 21 Jan 2025 15:19:06 +0100 Subject: [PATCH] chore: drop support for Weblate older than 5.9 --- requirements.txt | 2 +- weblate_fedora_messaging/models.py | 17 ++++++----------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/requirements.txt b/requirements.txt index 0001076..2917f8d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,4 +4,4 @@ django-appconf>=1.0.0,<1.1 fedora-messaging==3.7.0 setuptools>=65.5.1 twisted>=23.8.0 -Weblate>=5.6 +Weblate>=5.9 diff --git a/weblate_fedora_messaging/models.py b/weblate_fedora_messaging/models.py index f31f11e..98f6674 100644 --- a/weblate_fedora_messaging/models.py +++ b/weblate_fedora_messaging/models.py @@ -22,6 +22,7 @@ from django.dispatch import receiver from weblate.trans.models import Change from weblate.utils.decorators import disable_for_loaddata +from weblate.trans.signals import change_bulk_create from .tasks import fedora_messaging_change @@ -32,17 +33,11 @@ def fedora_notify_change(sender, instance, **kwargs): fedora_messaging_change.delay(instance.pk) -try: - from weblate.trans.signals import change_bulk_create -except ImportError: - pass -else: - - @receiver(change_bulk_create) - @disable_for_loaddata - def fedora_notify_change(sender, instances, **kwargs): - for instance in instances: - fedora_messaging_change.delay(instance.pk) +@receiver(change_bulk_create) +@disable_for_loaddata +def fedora_bulk_notify_change(sender, instances, **kwargs): + for instance in instances: + fedora_messaging_change.delay(instance.pk) class FedoraConf(AppConf):