Skip to content

Commit 096a5d4

Browse files
authored
Merge branch 'main' into shift-selling
2 parents 94a0c57 + 2120744 commit 096a5d4

7 files changed

Lines changed: 33 additions & 9 deletions

File tree

src/backoffice/views/facilities.py

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,34 @@ def post(self, request, camp_slug, slug):
9696
else:
9797
errorCount += 1
9898
continue
99-
obj, created = Facility.objects.update_or_create(
100-
name=props["name"],
101-
description=description,
102-
facility_type=facility_type,
103-
location=geom,
104-
)
99+
# Check if UUID in props then create/update with UUID
100+
if "uuid" in props:
101+
obj, created = Facility.objects.get_or_create(
102+
uuid=props["uuid"],
103+
facility_type=facility_type,
104+
)
105+
obj.name = props["name"]
106+
obj.description = description
107+
obj.location = geom
108+
obj.save()
109+
# Check if id in feature then create/update with id as UUID
110+
elif "id" in feature:
111+
obj, created = Facility.objects.get_or_create(
112+
uuid=feature["id"],
113+
facility_type=facility_type,
114+
)
115+
obj.name = props["name"]
116+
obj.description = description
117+
obj.location = geom
118+
obj.save()
119+
# Create/Update feature without UUID
120+
else:
121+
obj, created = Facility.objects.update_or_create(
122+
name=props["name"],
123+
description=description,
124+
facility_type=facility_type,
125+
location=geom,
126+
)
105127
if created:
106128
createdCount += 1
107129
else:

src/backoffice/views/maps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def load_feature_collection(self, layer, geojson) -> None:
113113
# parse single feature
114114
geom = self.load_features(feature["geometry"])
115115
self.create_feature_object(
116-
feature_uuid=feature.get("id"),
116+
feature_uuid=(feature["properties"].get("uuid", feature.get("id"))),
117117
props=feature["properties"],
118118
layer=layer,
119119
geom=geom,

src/camps/templates/bornhack-2025_camp_detail.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
{% block content %}
1111
<div class="row mt-3">
1212
<div class="col-12 text-center">
13-
<img src="{% static camp.logo_large %}" width="800" class="img-responsive" id="front-logo" />
13+
<img src="/static/img/bornhack-2025/logo/bornhack-2025-logo-l-for-light.png" width="800" class="front-logo img-responsive bornhack-hide-dark" />
14+
<img src="/static/img/bornhack-2025/logo/bornhack-2025-logo-l-for-dark.png" width="800" class="front-logo img-responsive bornhack-hide-light" />
1415
</div>
1516
</div>
1617

src/facilities/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def dump_features(self) -> list[object]:
5454
for facility in Facility.objects.filter(facility_type=ft.pk):
5555
entry = {
5656
"type": "Feature",
57-
"id": facility.pk,
57+
"facility_id": facility.pk,
5858
"geometry": {
5959
"type": "Point",
6060
"coordinates": [facility.location.x, facility.location.y],

src/maps/views.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ def get_context_data(self, **kwargs) -> dict:
267267
Feature.objects.filter(layer=self.layer.uuid),
268268
geometry_field="geom",
269269
fields=[
270+
"uuid",
270271
"name",
271272
"description",
272273
"color",
180 KB
Loading
173 KB
Loading

0 commit comments

Comments
 (0)