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:
Brian Simpson
2014-04-28 10:06:27 -04:00
parent 919fbca61a
commit d23ee7ab98
2 changed files with 4 additions and 3 deletions

View File

@@ -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:

View File

@@ -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