Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Commit aebf04f

Browse files
committed
Make Rohit suggested changes
1 parent 3e28326 commit aebf04f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

billing/views.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,11 @@ def invoice_payment_failed(self, invoice: stripe.Invoice) -> None:
6767

6868
# Send failed payment email to all owner admins
6969

70-
admins: QuerySet[Owner] = Owner.objects.filter(
71-
pk__in={admin for owner in owners for admin in owner.admins}
72-
)
70+
admin_ids = set()
71+
for owner in owners:
72+
admin_ids.update(owner.admins)
73+
74+
admins: QuerySet[Owner] = Owner.objects.filter(pk__in=admin_ids)
7375

7476
task_service = TaskService()
7577
card = (
@@ -86,7 +88,7 @@ def invoice_payment_failed(self, invoice: stripe.Invoice) -> None:
8688
}
8789

8890
for admin in admins:
89-
if admin.email is not None:
91+
if admin.email:
9092
task_service.send_email(
9193
to_addr=admin.email,
9294
subject="Your Codecov payment failed",

0 commit comments

Comments
 (0)