X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/e17ba704033aba068a935c1beb42d1f306e6a114..ca336bd1f9658cf713681d1412d4153e5c4d9c93:/src/push/forms.py?ds=inline 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()