Skip to content

Commit

Permalink
🐛 [BUG] Fix APIv2 exception on HD Views without Annotations (#4032)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chatewgne committed Aug 20, 2024
1 parent 9f59350 commit e99c04b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ CHANGELOG

**Improvements**

- Allow use of Annotation Categories on annotations other than Points (#4032)"
- Allow use of Annotation Categories on annotations other than Points (#4032)

**Bug fixes**

- Fix APIv2 exception on HD Views without Annotations (#4032)


2.109.0 (2024-08-08)
Expand Down
2 changes: 1 addition & 1 deletion geotrek/api/v2/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ def get_poi(self, obj):
def get_annotations(self, obj):
annotations = obj.annotations
annotations_categories = obj.annotations_categories
for feature in annotations["features"]:
for feature in annotations.get("features", []):
feat_id = feature["properties"]["annotationId"]
feat_type = feature["geometry"]["type"]
if feat_type == "Point" and str(feat_id) in annotations_categories.keys():
Expand Down

0 comments on commit e99c04b

Please sign in to comment.