fix: save social media audit results in arm_company.py script
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions
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 <noreply@anthropic.com>
This commit is contained in:
parent
4daf43f9f7
commit
c86d9cf368
@ -184,10 +184,10 @@ def arm_company(company_id, force=False):
|
|||||||
'address_city': company.address_city or '',
|
'address_city': company.address_city or '',
|
||||||
}
|
}
|
||||||
audit_result = auditor.audit_company(company_dict)
|
audit_result = auditor.audit_company(company_dict)
|
||||||
# Count profiles from social_media dict
|
# Save audit results to database (critical! without this profiles aren't persisted)
|
||||||
sm = audit_result.get('social_media', {}) if audit_result else {}
|
if audit_result:
|
||||||
profiles = len(sm.get('profiles', sm.get('links', [])))
|
auditor.save_audit_result(audit_result)
|
||||||
# Also check DB for actual saved count
|
# Check DB for actual saved count
|
||||||
db.expire_all()
|
db.expire_all()
|
||||||
saved_count = db.query(CompanySocialMedia).filter_by(company_id=company.id).count()
|
saved_count = db.query(CompanySocialMedia).filter_by(company_id=company.id).count()
|
||||||
results['social'] = 'OK (%d profili)' % saved_count
|
results['social'] = 'OK (%d profili)' % saved_count
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user