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:
@@ -148,18 +148,16 @@ export default function WorkflowGuide({ onSiteAdded }: WorkflowGuideProps) {
|
||||
try {
|
||||
setIsCreatingSite(true);
|
||||
|
||||
// Create site with user-provided name and domain
|
||||
// Create site with user-provided name, domain, and industry
|
||||
const newSite = await createSite({
|
||||
name: siteName.trim(),
|
||||
domain: websiteAddress.trim() || undefined,
|
||||
is_active: true,
|
||||
hosting_type: 'wordpress',
|
||||
industry: selectedIndustry.id, // Include industry ID - required by backend
|
||||
});
|
||||
|
||||
// Set industry for the site (if API supports it during creation, otherwise update)
|
||||
// For now, we'll set it via selectSectorsForSite which also sets industry
|
||||
|
||||
// Select sectors for the site (this also sets the industry)
|
||||
// Select sectors for the site
|
||||
await selectSectorsForSite(
|
||||
newSite.id,
|
||||
selectedIndustry.slug,
|
||||
|
||||
Reference in New Issue
Block a user