mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
Retrieve deleted users with paypal gold subscriptions.
They won't get any gold but the event is logged so the subscription can be deleted. Respond to paypal's IPN with a 200 rather than raising an exception so the IPN isn't retried.
This commit is contained in:
@@ -196,8 +196,8 @@ def existing_subscription(subscr_id, paying_id, custom):
|
||||
account = Account._byID(account_id, data=True)
|
||||
|
||||
if account._deleted:
|
||||
g.log.info("Just got IPN renewal for deleted account #%d"
|
||||
% account_id)
|
||||
g.log.info("IPN renewal for deleted account %d (%s)", account_id,
|
||||
subscr_id)
|
||||
return "deleted account"
|
||||
|
||||
if should_set_subscriber:
|
||||
|
||||
@@ -237,7 +237,8 @@ def accountid_from_paypalsubscription(subscr_id):
|
||||
return None
|
||||
|
||||
q = Account._query(Account.c.gold_subscr_id == subscr_id,
|
||||
Account.c._spam == (True, False), data=False)
|
||||
Account.c._spam == (True, False),
|
||||
Account.c._deleted == (True, False), data=False)
|
||||
l = list(q)
|
||||
if l:
|
||||
return l[0]._id
|
||||
|
||||
Reference in New Issue
Block a user