diff --git a/temba/channels/types/firebase/tests.py b/temba/channels/types/firebase/tests.py index c56ad808ab6..b968bf42fd3 100644 --- a/temba/channels/types/firebase/tests.py +++ b/temba/channels/types/firebase/tests.py @@ -62,7 +62,7 @@ def test_claim(self, mock_get): self.assertEqual( channel.config, { - "FCM_CREDENTIALS_JSON": {"foo": "bar", "baz": "abc", "private_key_id": "abcde12345"}, + "FCM_CREDENTIALS_JSON": '{"foo": "bar", "baz": "abc", "private_key_id": "abcde12345"}', "FCM_TITLE": "FCM Channel", "FCM_NOTIFICATION": True, }, diff --git a/temba/channels/types/firebase/views.py b/temba/channels/types/firebase/views.py index 6934104426a..40d3341be62 100644 --- a/temba/channels/types/firebase/views.py +++ b/temba/channels/types/firebase/views.py @@ -1,3 +1,5 @@ +import json + from smartmin.views import SmartFormView from django import forms @@ -41,7 +43,7 @@ def form_valid(self, form): title = form.cleaned_data.get("title") authentication_json = form.cleaned_data.get("authentication_json") address = form.cleaned_data.get("address") - config = {"FCM_TITLE": title, "FCM_CREDENTIALS_JSON": authentication_json} + config = {"FCM_TITLE": title, "FCM_CREDENTIALS_JSON": json.dumps(authentication_json)} if form.cleaned_data.get("send_notification") == "True": config["FCM_NOTIFICATION"] = True