Merge pull request #10382 from tchak/fix-commune-champ-task

fix(task): fix BackfillCommuneCodeFromNameTask
This commit is contained in:
Paul Chavard 2024-04-24 16:04:04 +00:00 committed by GitHub
commit 1c4af65338
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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:)