Skip to content

Commit

Permalink
Merge pull request #2784 from digitalfabrik/feature/poi-import-defaul…
Browse files Browse the repository at this point in the history
…t-closed

Mark locations as closed by default during CSV import
  • Loading branch information
timobrembeck authored May 7, 2024
2 parents de2a5ef + efcd987 commit 8a625c3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
11 changes: 10 additions & 1 deletion integreat_cms/core/management/commands/import_pois_from_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,16 @@ def get_opening_hours(self, poi: dict) -> list:
else []
),
"allDay": strtobool(poi[f"{day}_all_day"]),
"closed": strtobool(poi[f"{day}_closed"]),
"closed": (
strtobool(poi[f"{day}_closed"])
if poi[f"{day}_closed"]
else not (
poi[f"{day}_start"]
or poi[f"{day}_end"]
or poi[f"{day}_all_day"]
or poi[f"{day}_appointment_only"]
)
),
"appointmentOnly": strtobool(poi[f"{day}_appointment_only"]),
}
for day in [
Expand Down
2 changes: 2 additions & 0 deletions integreat_cms/release_notes/current/unreleased/2783.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
en: Mark locations as closed by default during CSV import
de: Markiere Orte beim CSV-Import standardmäßig als geschlossen
2 changes: 1 addition & 1 deletion tests/core/management/commands/assets/pois_to_import.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name,street_address,postal_code,city,country,latitude,longitude,location_on_map,website,email,phone_number,appointment_url,category,barrier_free,temporarily_closed,monday_start,monday_end,monday_all_day,monday_closed,monday_appointment_only,tuesday_start,tuesday_end,tuesday_all_day,tuesday_closed,tuesday_appointment_only,wednesday_start,wednesday_end,wednesday_all_day,wednesday_closed,wednesday_appointment_only,thursday_start,thursday_end,thursday_all_day,thursday_closed,thursday_appointment_only,friday_start,friday_end,friday_all_day,friday_closed,friday_appointment_only,saturday_start,saturday_end,saturday_all_day,saturday_closed,saturday_appointment_only,sunday_start,sunday_end,sunday_all_day,sunday_closed,sunday_appointment_only
"Café Tür an Tür",Wertachstr. 29,86153,Augsburg,,,,yes,"https://tuerantuer.de/cafe/",[email protected],0821/65075450,,Gastronomie,yes,no,,,,yes,,,,,yes,,,,,yes,,,,,yes,,,,,yes,,,,,yes,,,,,yes,
"Café Tür an Tür",Wertachstr. 29,86153,Augsburg,,,,yes,"https://tuerantuer.de/cafe/",[email protected],0821/65075450,,Gastronomie,yes,no,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
"Bellevue di Monaco",Müllerstraße 6,80469,München,,,,yes,"https://bellevuedimonaco.de/",[email protected],089 550 5775-0,"https://bellevuedimonaco.de/veranstaltungen/",Sonstiges,yes,no,,,,yes,,,,,yes,,,,,yes,,,,,yes,,,,,yes,,,,,yes,,,,,yes,
Brandenburger Tor,Pariser Platz,10117,Berlin,,,,yes,"https://www.berlin.de/sehenswuerdigkeiten/3560266-3558930-brandenburger-tor.html",,,,Treffpunkt,yes,no,09:00,17:00,,,,,,yes,,,09:00,17:00,,,,,,,yes,,09:00,17:00,,,,,,,yes,,,,,yes,

0 comments on commit 8a625c3

Please sign in to comment.