Drf-stripe-subscription

Latest version: v1.2.1

Safety actively analyzes 638884 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 3

1.1.1

Bug fix: Subscription event handler was not properly updating the SubscriptionItem table when a price plan is deleted from a Subscription.

1.1.0

The Subscription model now has a foreign key pointing to the StripeUser model instead of the Django User model. This reduces the coupling across the application.

Migrating from older version: you will need to drop all drf-stripe tables and run Django migrate command again to recreate new ones.

Added convenience methods to the StripUser model:

property
def subscription_items(self):
"""Returns a set of SubscriptionItem instances associated with the StripeUser"""

property
def current_subscription_items(self):
"""Returns a set of SubscriptionItem instances that grants current access."""

property
def subscribed_products(self):
"""Returns a set of Product instances the StripeUser currently has"""
return {item.price.product for item in self.current_subscription_items}

property
def subscribed_features(self):
"""Returns a set of Feature instances the StripeUser has access to."""
return set(chain.from_iterable(item.price.product.linked_features.all().prefetch_related("feature") for item in
self.current_subscription_items))

1.0.1

Added new endpoint for listing Stripe SubscriptionItems, updated README regarding Feature.

1.0.0

\\( ゚ヮ゚)/

Page 3 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.