fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
628b9fb
)
fix push form without image
author
Jan Szejko
<janek37@gmail.com>
Fri, 31 Aug 2018 12:07:21 +0000
(14:07 +0200)
committer
Jan Szejko
<janek37@gmail.com>
Fri, 31 Aug 2018 12:08:20 +0000
(14:08 +0200)
src/push/forms.py
patch
|
blob
|
history
diff --git
a/src/push/forms.py
b/src/push/forms.py
index
b49096d
..
f3c832b
100644
(file)
--- 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
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()
if commit:
notification.save()