From 543fc993284c10dcc2606b88b932a1a8064c7709 Mon Sep 17 00:00:00 2001 From: smathot Date: Fri, 26 Jul 2024 16:42:57 +0200 Subject: [PATCH] Yet another fix to the subscribe webhook --- sigmund/__init__.py | 2 +- sigmund/database/manager.py | 2 +- sigmund/routes/subscribe.py | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/sigmund/__init__.py b/sigmund/__init__.py index 2e99fb2..73cab76 100644 --- a/sigmund/__init__.py +++ b/sigmund/__init__.py @@ -1,3 +1,3 @@ """AI-based chatbot that provides sensible answers based on documentation""" -__version__ = '0.24.3' +__version__ = '0.24.4' diff --git a/sigmund/database/manager.py b/sigmund/database/manager.py index bf7a021..7c94359 100644 --- a/sigmund/database/manager.py +++ b/sigmund/database/manager.py @@ -311,7 +311,7 @@ def from_stripe_customer_id(stripe_customer_id: str) -> str: ).first() if not user_record: return None - return DatabaseManager(username=user_record.username) + return DatabaseManager(None, username=user_record.username) def get_setting(self, key: str) -> str: """Retrieve a setting value for the current user, which is available diff --git a/sigmund/routes/subscribe.py b/sigmund/routes/subscribe.py index ab3fcd0..43bd04c 100644 --- a/sigmund/routes/subscribe.py +++ b/sigmund/routes/subscribe.py @@ -157,8 +157,7 @@ def webhook(): elif event_type == 'invoice.payment_succeeded': # Attempt to get the user-specific database instance based on the # stripe customer id - database = DatabaseManager.from_stripe_customer_id( - None, stripe_customer_id) + database = DatabaseManager.from_stripe_customer_id(stripe_customer_id) # For new subscriptions, this fails because the link between the # stripe customer id and the sigmund user id still needs to be # established in checkout.session.completed, which is fired later.