summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-02-18 13:01:24 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-02-18 13:01:24 +0100
commite11aae53ab2c58911d6bca1f327d78dafc0920b7 (patch)
treea7bb0ce7f131f739a633b25c285735159bc2ff69
parentac36f95a1688f1fc63541e61166ae1c00f650b94 (diff)
downloadIshtar-e11aae53ab2c58911d6bca1f327d78dafc0920b7.tar.bz2
Ishtar-e11aae53ab2c58911d6bca1f327d78dafc0920b7.zip
import geofla: keep compatibility with old CSV
-rw-r--r--ishtar_common/management/commands/import_geofla_csv.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/ishtar_common/management/commands/import_geofla_csv.py b/ishtar_common/management/commands/import_geofla_csv.py
index 5a4d00be1..3b756381d 100644
--- a/ishtar_common/management/commands/import_geofla_csv.py
+++ b/ishtar_common/management/commands/import_geofla_csv.py
@@ -77,7 +77,10 @@ class Command(BaseCommand):
num_insee = row['INSEE_COM']
if len(num_insee) < 5:
num_insee = '0' + num_insee
- name = row['NOM_COM_M']
+ if 'NOM_COM_M' in row:
+ name = row['NOM_COM_M']
+ else:
+ name = row['NOM_COM'].upper()
town, created = self.get_town(num_insee, name, default_year)
if created:
nb_created += 1