refaktor címjegyzék

This commit is contained in:
Roo
2026-07-02 11:52:22 +00:00
parent 7654913d21
commit 07b59032ce
192 changed files with 2936 additions and 1376 deletions

View File

@@ -1338,10 +1338,25 @@ async def update_organization(
)
# 3. Összegyűjtjük a változásokat (non-address fields)
# P0 BUGFIX: Filter out deprecated denormalized address fields that were dropped from the DB
# These columns (address_city, billing_zip, etc.) were physically removed from fleet.organizations
# in cleanup_ghost_columns_2026_07.sql. The Organization model no longer has these attributes.
DEPRECATED_ADDRESS_FIELDS = {
"address_zip", "address_city", "address_street_name", "address_street_type", "address_house_number",
"billing_zip", "billing_city", "billing_street_name", "billing_street_type", "billing_house_number",
"notification_zip", "notification_city", "notification_street_name", "notification_street_type", "notification_house_number",
}
update_fields = {}
for field_name in raw_data:
value = raw_data[field_name]
if value is not None and hasattr(org, field_name):
# Skip deprecated address fields that no longer exist on the ORM model
if field_name in DEPRECATED_ADDRESS_FIELDS:
logger.warning(
f"Skipping deprecated field '{field_name}' for org {org_id}"
f"column was dropped from database. Use address_detail instead."
)
continue
setattr(org, field_name, value)
update_fields[field_name] = value