diff options
| 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 | 
| commit | 31ebccca222b6475ae75742ad68382d82e99a123 (patch) | |
| tree | a7bb0ce7f131f739a633b25c285735159bc2ff69 | |
| parent | 4730c9d39c400f26080af2f98d4e954e88b97d8d (diff) | |
| download | Ishtar-31ebccca222b6475ae75742ad68382d82e99a123.tar.bz2 Ishtar-31ebccca222b6475ae75742ad68382d82e99a123.zip  | |
import geofla: keep compatibility with old CSV
| -rw-r--r-- | ishtar_common/management/commands/import_geofla_csv.py | 5 | 
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  | 
