django bacekdn opeartioanl fixes and site wp integration api fixes
This commit is contained in:
@@ -244,14 +244,15 @@ class IntegrationService:
|
||||
}
|
||||
}
|
||||
|
||||
# Get API key from site
|
||||
# Get API key from Site.wp_api_key (SINGLE source of truth)
|
||||
# API key is stored on Site model for authentication by APIKeyAuthentication
|
||||
api_key = integration.site.wp_api_key
|
||||
|
||||
if not api_key:
|
||||
return {
|
||||
'success': False,
|
||||
'message': 'API key not configured.',
|
||||
'details': {}
|
||||
'message': 'API key not configured. Generate an API key in Site Settings.',
|
||||
'details': {'site_id': integration.site.id, 'site_name': integration.site.name}
|
||||
}
|
||||
|
||||
# Initialize health check results
|
||||
|
||||
@@ -39,8 +39,8 @@ class SyncMetadataService:
|
||||
try:
|
||||
# Get WordPress site URL and API key
|
||||
site_url = integration.config_json.get('site_url', '')
|
||||
credentials = integration.get_credentials()
|
||||
api_key = credentials.get('api_key', '')
|
||||
# API key is stored in Site.wp_api_key (SINGLE source of truth)
|
||||
api_key = integration.site.wp_api_key or ''
|
||||
|
||||
if not site_url:
|
||||
return {
|
||||
@@ -51,7 +51,7 @@ class SyncMetadataService:
|
||||
if not api_key:
|
||||
return {
|
||||
'success': False,
|
||||
'error': 'Missing api_key in integration credentials'
|
||||
'error': 'API key not configured for site. Generate one in Site Settings.'
|
||||
}
|
||||
|
||||
# Call WordPress metadata endpoint
|
||||
|
||||
Reference in New Issue
Block a user