Skip to content

Commit

Permalink
Yet another fix to the subscribe webhook
Browse files Browse the repository at this point in the history
  • Loading branch information
smathot committed Jul 26, 2024
1 parent ad89154 commit 543fc99
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sigmund/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""AI-based chatbot that provides sensible answers based on documentation"""

__version__ = '0.24.3'
__version__ = '0.24.4'
2 changes: 1 addition & 1 deletion sigmund/database/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions sigmund/routes/subscribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 543fc99

Please sign in to comment.