feat: add Usage Limits Panel component with usage tracking and visual indicators for limits
style: implement custom color schemes and gradients for account section, enhancing visual hierarchy
This commit is contained in:
@@ -529,6 +529,14 @@ class SiteViewSet(AccountModelViewSet):
|
||||
if user and user.is_authenticated:
|
||||
account = getattr(user, 'account', None)
|
||||
|
||||
# Check hard limit for sites
|
||||
from igny8_core.business.billing.services.limit_service import LimitService, HardLimitExceededError
|
||||
try:
|
||||
LimitService.check_hard_limit(account, 'sites', additional_count=1)
|
||||
except HardLimitExceededError as e:
|
||||
from rest_framework.exceptions import PermissionDenied
|
||||
raise PermissionDenied(str(e))
|
||||
|
||||
# Multiple sites can be active simultaneously - no constraint
|
||||
site = serializer.save(account=account)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user