mirror of
https://github.com/simple-login/app.git
synced 2024-09-30 05:31:30 +02:00
Handle the case "Restore Purchase" on another account
This commit is contained in:
parent
b5b4fe2773
commit
840f827b45
@ -269,7 +269,7 @@ def verify_receipt(receipt_data, user) -> Optional[AppleSubscription]:
|
|||||||
|
|
||||||
if apple_sub:
|
if apple_sub:
|
||||||
LOG.d(
|
LOG.d(
|
||||||
"Create new AppleSubscription for user %s, expired at %s, plan %s",
|
"Update AppleSubscription for user %s, expired at %s, plan %s",
|
||||||
user,
|
user,
|
||||||
expires_date,
|
expires_date,
|
||||||
plan,
|
plan,
|
||||||
@ -279,6 +279,11 @@ def verify_receipt(receipt_data, user) -> Optional[AppleSubscription]:
|
|||||||
apple_sub.original_transaction_id = original_transaction_id
|
apple_sub.original_transaction_id = original_transaction_id
|
||||||
apple_sub.plan = plan
|
apple_sub.plan = plan
|
||||||
else:
|
else:
|
||||||
|
# the same original_transaction_id has been used on another account
|
||||||
|
if AppleSubscription.get_by(original_transaction_id=original_transaction_id):
|
||||||
|
LOG.error("Same Apple Sub has been used before, current user %s", user)
|
||||||
|
return None
|
||||||
|
|
||||||
LOG.d(
|
LOG.d(
|
||||||
"Create new AppleSubscription for user %s, expired at %s, plan %s",
|
"Create new AppleSubscription for user %s, expired at %s, plan %s",
|
||||||
user,
|
user,
|
||||||
|
Loading…
Reference in New Issue
Block a user