From 2a15c14ee87e308cba60cf191b43fc2f4f9dbefc Mon Sep 17 00:00:00 2001 From: Samir Boulahtit Date: Sun, 29 Mar 2026 17:49:31 +0200 Subject: [PATCH] fix(tenancy): use is_production() for invitation URL instead of debug flag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using debug flag for environment detection is unreliable — if left True in prod, links would point to localhost. Now uses the proper is_production() from environment module. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../prospecting/static/admin/js/scan-jobs.js | 15 ++++++++++++++- .../templates/prospecting/admin/scan-jobs.html | 5 ----- .../tenancy/services/store_team_service.py | 15 +++++++-------- static/shared/js/api-client.js | 11 +++++------ 4 files changed, 26 insertions(+), 20 deletions(-) diff --git a/app/modules/prospecting/static/admin/js/scan-jobs.js b/app/modules/prospecting/static/admin/js/scan-jobs.js index 62c570f4..ea4547f7 100644 --- a/app/modules/prospecting/static/admin/js/scan-jobs.js +++ b/app/modules/prospecting/static/admin/js/scan-jobs.js @@ -47,9 +47,22 @@ function scanJobs() { } }, + // Maps button job types to actual API route segments + batchRoutes: { + 'http_check': 'http-check', + 'tech_scan': 'tech-scan', + 'performance_scan': 'performance', + 'score_compute': 'score-compute', + }, + async startBatchJob(jobType) { + var route = this.batchRoutes[jobType]; + if (!route) { + Utils.showToast('Unknown job type: ' + jobType, 'error'); + return; + } try { - await apiClient.post('/admin/prospecting/enrichment/' + jobType.replace('_', '-') + '/batch'); + await apiClient.post('/admin/prospecting/enrichment/' + route + '/batch'); Utils.showToast(jobType.replace(/_/g, ' ') + ' batch started', 'success'); setTimeout(() => this.loadJobs(), 2000); } catch (err) { diff --git a/app/modules/prospecting/templates/prospecting/admin/scan-jobs.html b/app/modules/prospecting/templates/prospecting/admin/scan-jobs.html index edd97b56..b5e3616e 100644 --- a/app/modules/prospecting/templates/prospecting/admin/scan-jobs.html +++ b/app/modules/prospecting/templates/prospecting/admin/scan-jobs.html @@ -29,11 +29,6 @@ Performance Scan -