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:
@@ -321,10 +321,17 @@ class RegisterSerializer(serializers.Serializer):
|
||||
role='owner'
|
||||
)
|
||||
|
||||
# Now create account with user as owner
|
||||
# Now create account with user as owner, ensuring slug uniqueness
|
||||
base_slug = account_name.lower().replace(' ', '-').replace('_', '-')[:50] or 'account'
|
||||
slug = base_slug
|
||||
counter = 1
|
||||
while Account.objects.filter(slug=slug).exists():
|
||||
slug = f"{base_slug}-{counter}"
|
||||
counter += 1
|
||||
|
||||
account = Account.objects.create(
|
||||
name=account_name,
|
||||
slug=account_name.lower().replace(' ', '-').replace('_', '-')[:50],
|
||||
slug=slug,
|
||||
owner=user,
|
||||
plan=plan
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user