sendmail: Do not copy rules with subevent when closing an event (Z#23233683) (#6156)

This commit is contained in:
pajowu
2026-05-06 15:56:06 +02:00
committed by GitHub
parent 14708eef80
commit 5bbbf0334d
3 changed files with 60 additions and 2 deletions

View File

@@ -232,7 +232,7 @@ def sendmail_copy_data_receiver(sender, other, item_map, **kwargs):
if sender.sendmail_rules.exists(): # idempotency
return
for r in other.sendmail_rules.prefetch_related('limit_products'):
for r in other.sendmail_rules.filter(subevent__isnull=True).prefetch_related('limit_products'):
limit_products = list(r.limit_products.all())
r = copy.copy(r)
r.pk = None