Skip to content

Commit

Permalink
Merge pull request #1270 from digitalfabrik/develop
Browse files Browse the repository at this point in the history
Deploy fixed fcm API endpoint
  • Loading branch information
svenseeberg authored Mar 6, 2022
2 parents 2c72df7 + 5067852 commit c6a4def
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
UNRELEASED
----------

* [ [#1269](https://github.com/digitalfabrik/integreat-cms/issues/1269) ] Fix fcm endpoint JSON format


2022.3.1
--------
Expand Down
6 changes: 3 additions & 3 deletions integreat_cms/api/v3/push_notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ def transform_notification(pnt):
:rtype: dict
"""
return {
"id": str(pnt.pk),
"title": pnt.title,
"text": pnt.text,
"channel": pnt.push_notification.channel,
"sent_date": pnt.push_notification.sent_date,
"message": pnt.text,
"timestamp": pnt.push_notification.sent_date.strftime("%Y-%m-%d %H:%M:%S"),
}
2 changes: 1 addition & 1 deletion tests/api/expected-outputs/nurnberg_de_fcm.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"title": "Test DE", "text": "Test DE Inhalt", "channel": "news", "sent_date": "2022-03-05T10:32:33.118Z"}]
[{"id": "1", "title": "Test DE", "message": "Test DE Inhalt", "timestamp": "2022-03-05 10:32:33"}]
2 changes: 1 addition & 1 deletion tests/api/expected-outputs/nurnberg_en_fcm.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"title": "Test EN", "text": "Test EN content", "channel": "news", "sent_date": "2022-03-05T10:32:33.118Z"}]
[{"id": "2", "title": "Test EN", "message": "Test EN content", "timestamp": "2022-03-05 10:32:33"}]

0 comments on commit c6a4def

Please sign in to comment.