Skip to content

Commit

Permalink
šŸ› [BUG] Fix missing languages for 'published' field on Touristic Contā€¦
Browse files Browse the repository at this point in the history
ā€¦ent in APIv2 (refs #4439)
  • Loading branch information
Chatewgne committed Jan 14, 2025
1 parent 06f4cd4 commit 06d65b0
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 06d65b0

Please sign in to comment.