From 594ca8a0b3632ea7c785c6433b271bafd85bd0d7 Mon Sep 17 00:00:00 2001 From: Jan Szejko Date: Fri, 31 Aug 2018 14:07:21 +0200 Subject: [PATCH 1/1] fix push form without image --- src/push/forms.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/push/forms.py b/src/push/forms.py index b49096db1..f3c832b9d 100644 --- a/src/push/forms.py +++ b/src/push/forms.py @@ -18,6 +18,10 @@ class NotificationForm(forms.ModelForm): def save(self, commit=True): notification = super(NotificationForm, self).save(commit=commit) wl_base = u'https://' + Site.objects.get_current().domain - notification.message_id = send_fcm_push(notification.title, notification.body, wl_base + notification.image.url) + if notification.image: + image_url = wl_base + notification.image.url + else: + image_url = None + notification.message_id = send_fcm_push(notification.title, notification.body, image_url) if commit: notification.save() -- 2.20.1