Fix: Truncate country code til max 2 chars (ISO format)

This commit is contained in:
Christian 2025-12-22 13:17:03 +01:00
parent 4042c466f8
commit 198c6c56f4

View File

@ -334,6 +334,14 @@ async def sync_from_economic() -> Dict[str, Any]:
if len(cvr) != 8:
cvr = None
# Clean country code (max 2 chars for ISO codes)
if country:
country = str(country).strip().upper()[:2]
if not country:
country = 'DK'
else:
country = 'DK'
# Extract email domain
email_domain = email.split('@')[-1] if '@' in email else None