fix: correct Company model field references in get_company_context
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

Use category relationship (company.category.name) instead of non-existent
direct attribute, and description_full/description_short instead of
non-existent description/short_description fields.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Maciej Pienczyn 2026-02-19 09:29:08 +01:00
parent c4036f0a62
commit 921f72f569

View File

@ -417,11 +417,14 @@ class SocialPublisherService:
company = db.query(Company).filter(Company.id == company_id).first()
if not company:
return {}
category_name = ''
if company.category_id and company.category:
category_name = company.category.name
return {
'company_name': company.name or '',
'category': company.category or '',
'category': category_name,
'city': company.address_city or 'Wejherowo',
'description': company.description or company.short_description or '',
'description': company.description_full or company.description_short or '',
'website': company.website or '',
}
finally: