Refactor API permissions and throttling: Updated default permission classes to enforce authentication and tenant access. Introduced new permission for system accounts and developers. Enhanced throttling rates for various operations to reduce false 429 errors. Improved API key loading logic to prioritize account-specific settings, with fallbacks to system accounts and Django settings. Updated integration views and sidebar to reflect new permission structure.
This commit is contained in:
@@ -49,7 +49,7 @@ export default function WorkflowGuide({ onSiteAdded }: WorkflowGuideProps) {
|
||||
const [siteName, setSiteName] = useState('');
|
||||
const [websiteAddress, setWebsiteAddress] = useState('');
|
||||
|
||||
// Load dismissal state from backend on mount
|
||||
// Load dismissal state from backend on mount (guarded in store)
|
||||
useEffect(() => {
|
||||
if (isAuthenticated) {
|
||||
loadFromBackend().catch(() => {
|
||||
@@ -67,8 +67,11 @@ export default function WorkflowGuide({ onSiteAdded }: WorkflowGuideProps) {
|
||||
setLoadingIndustries(true);
|
||||
const response = await fetchIndustries();
|
||||
setIndustries(response.industries || []);
|
||||
} catch (error) {
|
||||
console.error('Failed to load industries:', error);
|
||||
} catch (error: any) {
|
||||
// Swallow 429 to avoid noisy console; user can retry via toggle
|
||||
if (error?.status !== 429) {
|
||||
console.error('Failed to load industries:', error);
|
||||
}
|
||||
} finally {
|
||||
setLoadingIndustries(false);
|
||||
}
|
||||
@@ -108,8 +111,10 @@ export default function WorkflowGuide({ onSiteAdded }: WorkflowGuideProps) {
|
||||
setLoadingIndustries(true);
|
||||
const response = await fetchIndustries();
|
||||
setIndustries(response.industries || []);
|
||||
} catch (error) {
|
||||
console.error('Failed to load industries:', error);
|
||||
} catch (error: any) {
|
||||
if (error?.status !== 429) {
|
||||
console.error('Failed to load industries:', error);
|
||||
}
|
||||
} finally {
|
||||
setLoadingIndustries(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user