Skip to content

Commit

Permalink
Fix sending feedback for recurring events
Browse files Browse the repository at this point in the history
  • Loading branch information
seluianova committed Oct 31, 2022
1 parent d38f5b0 commit aefd9b8
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 aefd9b8

Please sign in to comment.