Skip to content

Commit

Permalink
Merge pull request #3725 from juggler31/issue_3587
Browse files Browse the repository at this point in the history
Add organizer_id on TouristicEvent endpoint (refs #3587)
  • Loading branch information
babastienne authored Sep 27, 2023
2 parents d88aef3 + 8384657 commit 6122804
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ CHANGELOG
**Improvements**

- Remove 'review' field on ServiceType (#1669)
- Add organizer_id on TouristicEvent endpoint ( #3587)

**Documentation**

Expand Down
2 changes: 1 addition & 1 deletion geotrek/api/tests/test_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
TOURISTIC_EVENT_DETAIL_JSON_STRUCTURE = sorted([
'id', 'accessibility', 'approved', 'attachments', 'begin_date', 'bookable', 'booking', 'cities', 'contact', 'create_datetime',
'description', 'description_teaser', 'districts', 'duration', 'email', 'end_date', 'external_id', 'geometry',
'meeting_point', 'start_time', 'meeting_time', 'end_time', 'name', 'organizer', 'capacity', 'pdf', 'place', 'portal',
'meeting_point', 'start_time', 'meeting_time', 'end_time', 'name', 'organizer', 'organizer_id', 'capacity', 'pdf', 'place', 'portal',
'practical_info', 'provider', 'published', 'source', 'speaker', 'structure', 'target_audience', 'themes',
'type', 'update_datetime', 'url', 'uuid', 'website', 'cancelled', 'cancellation_reason', 'participant_number'
])
Expand Down
5 changes: 4 additions & 1 deletion geotrek/api/v2/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,9 @@ class TouristicEventSerializer(TouristicModelSerializer):
read_only=True,
slug_field='label'
)
organizer_id = serializers.PrimaryKeyRelatedField(
read_only=True
)
attachments = AttachmentSerializer(many=True, source='sorted_attachments')
url = HyperlinkedIdentityField(view_name='apiv2:touristicevent-detail')
begin_date = serializers.DateField()
Expand Down Expand Up @@ -547,7 +550,7 @@ class Meta(TimeStampedSerializer.Meta):
'booking', 'cancellation_reason', 'cancelled', 'capacity', 'cities',
'contact', 'description', 'description_teaser', 'districts', 'duration',
'email', 'end_date', 'end_time', 'external_id', 'geometry', 'meeting_point',
'meeting_time', 'name', 'organizer', 'participant_number', 'pdf', 'place',
'meeting_time', 'name', 'organizer', 'organizer_id', 'participant_number', 'pdf', 'place',
'portal', 'practical_info', 'provider', 'published', 'source', 'speaker',
'start_time', 'structure', 'target_audience', 'themes', 'type',
'url', 'uuid', 'website'
Expand Down

0 comments on commit 6122804

Please sign in to comment.