Skip to content

Commit

Permalink
Merge pull request #4440 from GeotrekCE/fix_api_v2_published_touristi…
Browse files Browse the repository at this point in the history
…c_content

🐛 [BUG] Fix missing languages for 'published' field on Touristic Content in APIv2 (#4439)
  • Loading branch information
Chatewgne authored Jan 14, 2025
2 parents 06f4cd4 + 06d65b0 commit 5a7a989
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ CHANGELOG
**Bug fixes**

- Prevent objects from being returned several times in APIv2 by filtering on ManyToMany (#4448)
- Fix missing languages for `published` field on Touristic Content in APIv2 (#4439)

**Documentation**

Expand Down
4 changes: 4 additions & 0 deletions geotrek/api/v2/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,10 @@ class TouristicModelSerializer(PDFSerializerMixin, DynamicFieldsMixin, TimeStamp
description_teaser = serializers.SerializerMethodField()
practical_info = serializers.SerializerMethodField()
pdf = serializers.SerializerMethodField('get_pdf_url')
published = serializers.SerializerMethodField()

def get_published(self, obj):
return get_translation_or_dict('published', self, obj)

def get_accessibility(self, obj):
return get_translation_or_dict('accessibility', self, obj)
Expand Down

0 comments on commit 5a7a989

Please sign in to comment.