mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Counting deleted paypal payments.
This commit is contained in:
parent
85327ca942
commit
6b0dc6dd51
1 changed files with 5 additions and 1 deletions
|
@ -493,12 +493,16 @@ class Profile(models.Model):
|
|||
if self.paypal_sub_id:
|
||||
seen_payments = set()
|
||||
seen_payment_history = PaymentHistory.objects.filter(user=self.user)
|
||||
for payment in seen_payment_history:
|
||||
deleted_paypal_payments = 0
|
||||
for payment in list(seen_payment_history):
|
||||
if payment.payment_date.date() in seen_payments:
|
||||
payment.delete()
|
||||
deleted_paypal_payments += 1
|
||||
else:
|
||||
seen_payments.add(payment.payment_date.date())
|
||||
total_paypal_payments += 1
|
||||
if deleted_paypal_payments > 0:
|
||||
logging.user(self.user, f"~BY~SN~FRDeleting~FW duplicate paypal history: ~SB{deleted_paypal_payments} payments")
|
||||
paypal_api = self.paypal_api()
|
||||
for paypal_id_model in self.user.paypal_ids.all():
|
||||
paypal_id = paypal_id_model.paypal_sub_id
|
||||
|
|
Loading…
Add table
Reference in a new issue