Skip to content

Commit ce9176d

Browse files
committed
fix(billing): do not add already added users
This just pollutes the history.
1 parent 5f2138d commit ce9176d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

weblate/billing/models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,10 @@ def record_project_bill(
718718
if isinstance(instance, Project):
719719
users = User.objects.having_perm("project.edit", instance)
720720
for billing in instance.billing_set.all():
721+
existing_owners = set(billing.owners.values_list("id", flat=True))
721722
for user in users:
723+
if user.id in existing_owners:
724+
continue
722725
billing.owners.add(user)
723726
billing.billinglog_set.create(
724727
event=BillingEvent.ADMIN_ADDED_PROJECT, summary=user.username

0 commit comments

Comments
 (0)