fix(commune): fix ‘undefined’ departement codes

This commit is contained in:
Paul Chavard 2023-04-27 11:56:45 +02:00
parent b0f4c578a6
commit 1d10e59e63
3 changed files with 38 additions and 2 deletions

View file

@ -5,7 +5,7 @@ class Migrations::NormalizeCommunesJob < ApplicationJob
value_json = champ.value_json || {}
if !champ.departement?
if !champ.departement? || champ.code_departement == 'undefined'
metro_code = champ.external_id[0..1]
drom_com_code = champ.external_id[0..2]