Merge pull request #10382 from tchak/fix-commune-champ-task
fix(task): fix BackfillCommuneCodeFromNameTask
This commit is contained in:
commit
1c4af65338
1 changed files with 4 additions and 4 deletions
|
@ -14,11 +14,11 @@ module Maintenance
|
||||||
return if champ.external_id.present?
|
return if champ.external_id.present?
|
||||||
return if champ.value.blank?
|
return if champ.value.blank?
|
||||||
|
|
||||||
data = champ.data
|
value_json = champ.value_json
|
||||||
return if data.blank?
|
return if value_json.blank?
|
||||||
return if data['code_departement'].blank?
|
return if value_json['code_departement'].blank?
|
||||||
|
|
||||||
external_id = APIGeoService.commune_code(data['code_departement'], champ.value)
|
external_id = APIGeoService.commune_code(value_json['code_departement'], champ.value)
|
||||||
|
|
||||||
if external_id.present?
|
if external_id.present?
|
||||||
champ.update(external_id:)
|
champ.update(external_id:)
|
||||||
|
|
Loading…
Reference in a new issue