Skip to content

Commit ca0c85d

Browse files
committed
Manage CLEF address importation based on 2 columns
1 parent 8a81559 commit ca0c85d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

accommodation/management/commands/import_CLEF.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ def handle(self, *args, **options):
4242
accommodation = Accommodation(name=name)
4343

4444
for attr_db, attr_clef in [
45-
("address", "Adresse administrative"),
4645
("city", "Commune"),
4746
("postal_code", "Code postal"),
4847
("owner_name", "Gestionnaire - Nom"),
@@ -62,6 +61,8 @@ def handle(self, *args, **options):
6261

6362
setattr(accommodation, attr_db, value)
6463

64+
accommodation.address = row.get("Adresse administrative") or row.get("Adresse géolocalisée")
65+
6566
if (latitude := row.get("Latitude")) and (longitude := row.get("Longitude")):
6667
try:
6768
accommodation.geom = Point(

0 commit comments

Comments
 (0)