From c86d9cf3681e0fdef486b0c79c7a4033c82d22b1 Mon Sep 17 00:00:00 2001 From: Maciej Pienczyn Date: Fri, 20 Feb 2026 17:01:43 +0100 Subject: [PATCH] fix: save social media audit results in arm_company.py script The script was calling auditor.audit_company() but not auditor.save_audit_result(), causing profiles to be found but never persisted to the database. Co-Authored-By: Claude Opus 4.6 --- scripts/arm_company.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/arm_company.py b/scripts/arm_company.py index a34fd37..09afa8a 100644 --- a/scripts/arm_company.py +++ b/scripts/arm_company.py @@ -184,10 +184,10 @@ def arm_company(company_id, force=False): 'address_city': company.address_city or '', } audit_result = auditor.audit_company(company_dict) - # Count profiles from social_media dict - sm = audit_result.get('social_media', {}) if audit_result else {} - profiles = len(sm.get('profiles', sm.get('links', []))) - # Also check DB for actual saved count + # Save audit results to database (critical! without this profiles aren't persisted) + if audit_result: + auditor.save_audit_result(audit_result) + # Check DB for actual saved count db.expire_all() saved_count = db.query(CompanySocialMedia).filter_by(company_id=company.id).count() results['social'] = 'OK (%d profili)' % saved_count