From 998e1d7aef57d9cc8341ec22f35bb9948d352c7c Mon Sep 17 00:00:00 2001 From: Son Date: Tue, 10 May 2022 18:51:04 +0200 Subject: [PATCH 1/2] handle subscription cancel from deleted user --- server.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server.py b/server.py index c09127e7..3ba89f63 100644 --- a/server.py +++ b/server.py @@ -513,7 +513,9 @@ def setup_paddle_callback(app: Flask): ) else: - return "No such subscription", 400 + # user might have deleted their account + LOG.i(f"Cancel non-exist subscription {subscription_id}") + return "OK" elif request.form.get("alert_name") == "subscription_updated": subscription_id = request.form.get("subscription_id") From e1ca90a28e235739be491934d26e42a27b06dd00 Mon Sep 17 00:00:00 2001 From: Son Date: Tue, 10 May 2022 18:53:21 +0200 Subject: [PATCH 2/2] log when subscription not exist --- server.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server.py b/server.py index 3ba89f63..2de10c41 100644 --- a/server.py +++ b/server.py @@ -549,6 +549,9 @@ def setup_paddle_callback(app: Flask): Session.commit() else: + LOG.w( + f"update non-exist subscription {subscription_id}. {request.form}" + ) return "No such subscription", 400 elif request.form.get("alert_name") == "payment_refunded": subscription_id = request.form.get("subscription_id")