Skip to content

Commit

Permalink
Merge pull request #1497 from RoboSats/avoid-duplicated-notifications
Browse files Browse the repository at this point in the history
Avoid duplicated notifications
  • Loading branch information
KoalaSat authored Sep 25, 2024
2 parents 98a16e6 + a050ed1 commit b2ff141
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/models/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,8 @@ def update_status(self, new_status):
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)
Expand Down

0 comments on commit b2ff141

Please sign in to comment.