Skip to content

Commit

Permalink
Merge pull request #1810 from digitalfabrik/bugfix/fix-feedback-for-r…
Browse files Browse the repository at this point in the history
…ecurring-events

Fix sending feedback for recurring events
  • Loading branch information
seluianova authored Oct 31, 2022
2 parents d38f5b0 + aefd9b8 commit 2d1e36c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ UNRELEASED
----------

* [ [#1718](https://github.com/digitalfabrik/integreat-cms/issues/1718) ] Enable submitting feedback about fallback translations of events and pois
* [ [#1793](https://github.com/digitalfabrik/integreat-cms/issues/1793) ] Fix sending feedback for recurring events


2022.10.2
Expand Down
6 changes: 4 additions & 2 deletions integreat_cms/api/v3/feedback/event_feedback.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import re

from django.http import JsonResponse, Http404

Expand Down Expand Up @@ -67,10 +68,11 @@ def event_feedback_internal(data, region, language, comment, rating, is_technica
:return: JSON object according to APIv3 single page feedback endpoint definition
:rtype: ~django.http.JsonResponse
"""
event_translation_slug = data.get("slug")
# Remove date from the slug for recurrung events
event_translation_slug = re.sub(r"\$\d{4}-\d{2}-\d{2}$", "", data.get("slug"))

events = region.events.filter(
translations__slug=data.get("slug"),
translations__slug=event_translation_slug,
translations__language=language,
).distinct()

Expand Down

0 comments on commit 2d1e36c

Please sign in to comment.