Enhance billing and subscription management: Added payment method checks in ProtectedRoute, improved error handling in billing components, and optimized API calls to reduce throttling. Updated user account handling in various components to ensure accurate plan and subscription data display.
This commit is contained in:
@@ -341,7 +341,8 @@ class SubscriptionsViewSet(AccountModelViewSet):
|
||||
queryset = Subscription.objects.all()
|
||||
permission_classes = [IsAuthenticatedAndActive, HasTenantAccess, IsOwnerOrAdmin]
|
||||
pagination_class = CustomPageNumberPagination
|
||||
throttle_scope = 'auth'
|
||||
# Use relaxed auth throttle to avoid 429s during onboarding plan fetches
|
||||
throttle_scope = 'auth_read'
|
||||
throttle_classes = [DebugScopedRateThrottle]
|
||||
|
||||
def get_queryset(self):
|
||||
@@ -445,8 +446,9 @@ class PlanViewSet(viewsets.ReadOnlyModelViewSet):
|
||||
serializer_class = PlanSerializer
|
||||
permission_classes = [permissions.AllowAny]
|
||||
pagination_class = CustomPageNumberPagination
|
||||
throttle_scope = 'auth'
|
||||
throttle_classes = [DebugScopedRateThrottle]
|
||||
# Plans are public and should not throttle aggressively to avoid blocking signup/onboarding
|
||||
throttle_scope = None
|
||||
throttle_classes: list = []
|
||||
|
||||
def retrieve(self, request, *args, **kwargs):
|
||||
"""Override retrieve to return unified format"""
|
||||
|
||||
Reference in New Issue
Block a user