[go: up one dir, main page]

Skip to content

Commit

Permalink
Avoid duplicated notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
KoalaSat committed Sep 25, 2024
1 parent 98a16e6 commit a050ed1
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 a050ed1

Please sign in to comment.