Merge pull request #1497 from RoboSats/avoid-duplicated-notifications
Some checks failed
Lint: Python Coordinator / Run linters (push) Has been cancelled

Avoid duplicated notifications
This commit is contained in:
KoalaSat 2024-09-25 11:56:59 +00:00 committed by GitHub
commit b2ff14151b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -350,7 +350,8 @@ class Order(models.Model):
self.log(
f"Order state went from {old_status}: <i>{Order.Status(old_status).label}</i> to {new_status}: <i>{Order.Status(new_status).label}</i>"
)
send_status_notification.delay(order_id=self.id, status=self.status)
if old_status != new_status:
send_status_notification.delay(order_id=self.id, status=self.status)
@receiver(pre_delete, sender=Order)