feat(multi-tenancy): implement critical fixes for orphaned users and permissions
- Simplified HasTenantAccess permission logic to ensure every authenticated user has an account. - Added fallback to system account for OpenAI settings in AI configuration. - Allowed any authenticated user to check task progress in IntegrationSettingsViewSet. - Created a script to identify and fix orphaned users without accounts. - Updated error response handling in business endpoints for clarity.
This commit is contained in:
@@ -5,6 +5,7 @@ from django_filters.rest_framework import DjangoFilterBackend
|
||||
from django.db import transaction
|
||||
from django.db.models import Max, Count, Sum, Q
|
||||
from django.http import HttpResponse
|
||||
from django.conf import settings
|
||||
import csv
|
||||
import json
|
||||
import time
|
||||
@@ -655,10 +656,10 @@ class KeywordViewSet(SiteSectorModelViewSet):
|
||||
error=validation['error'],
|
||||
status_code=status.HTTP_400_BAD_REQUEST,
|
||||
request=request,
|
||||
extra_data={
|
||||
debug_info={
|
||||
'count': validation.get('count'),
|
||||
'required': validation.get('required')
|
||||
}
|
||||
} if settings.DEBUG else None
|
||||
)
|
||||
|
||||
# Validation passed - proceed with clustering
|
||||
|
||||
Reference in New Issue
Block a user