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 6, 2025
1 parent 4dba2fb commit 3d889a4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ CHANGELOG
- Fix typo in documentation
- Update and homogenize README.rst

**Bug fixes**

- Fix missing languages for `published` field on Touristic Content in APIv2 (#4439)


2.111.0 (2024-12-05)
----------------------------

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 @@ -505,6 +505,10 @@ class TouristicContentSerializer(TouristicModelSerializer):
departure_city = serializers.SerializerMethodField()
types = serializers.SerializerMethodField()
url = HyperlinkedIdentityField(view_name='apiv2:touristiccontent-detail')
published = serializers.SerializerMethodField()

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

class Meta(TimeStampedSerializer.Meta):
model = tourism_models.TouristicContent
Expand Down

0 comments on commit 3d889a4

Please sign in to comment.