deploy ui rebuild v2
CI / compose (push) Successful in 13m48s

This commit is contained in:
Marco0300
2026-09-04 14:16:29 +02:00
parent 28e1ac20a8
commit 9258bfd811
3 changed files with 10 additions and 4 deletions
+7 -2
View File
@@ -1367,7 +1367,12 @@ class ApiHandler(BaseHTTPRequestHandler):
except (TypeError,ValueError): policy={}
credential_exists = bool(db.execute("SELECT 1 FROM source_credentials WHERE source_id=? AND organization_id=? AND provider=? AND key_name=?", (raw["id"], org, "google_places", "api_key")).fetchone())
item.update({"available": bool(meta.get("available", False)), "optional": bool(meta.get("optional", False)),
"configured": bool(meta.get("available", False) and (config.get("csv") or config.get("rows") is not None or raw["approved"])),
# Older registered free-source rows may have approved=0
# even though their validated config is approved. Treat
# either signal as configured so the operator can test
# and enable the existing source instead of being sent
# back through setup.
"configured": bool(meta.get("available", False) and (config.get("csv") or config.get("rows") is not None or raw["approved"] or config.get("approved") is True)),
"credential_status": ("Configured" if credential_exists else "Required / not configured") if meta.get("requires_credentials") else "Not required",
"terms_status": "Provided" if policy.get("terms_url") or config.get("terms_url") else "Not reviewed",
"owner": policy.get("owner") or config.get("owner") or "Not assigned",
@@ -1431,7 +1436,7 @@ class ApiHandler(BaseHTTPRequestHandler):
adapter=adapter_for(source['source_code'] or source['kind'])
try: config=json.loads(source['config_json'] or '{}')
except (TypeError,ValueError): config={}
metadata=next((item for item in available_adapters() if item['source_code']==source['kind']), {})
metadata=next((item for item in available_adapters() if item['source_code']==(source['source_code'] or source['kind'])), {})
if not metadata.get('available', False): return self.send_json(409,{"error":"source_unavailable"})
validation=adapter.validate_config(config)
# A blank manual source is a deliberate staging point: the query or