mirror of
https://github.com/fergalmoran/dss.git
synced 2025-12-22 09:38:18 +00:00
Corrected image in gritter
This commit is contained in:
@@ -7,7 +7,7 @@ from django.template import loader, Context
|
|||||||
|
|
||||||
from core.realtime.notification import post_notification
|
from core.realtime.notification import post_notification
|
||||||
from dss import localsettings
|
from dss import localsettings
|
||||||
from spa.models import BaseModel
|
from spa.models import BaseModel, UserProfile
|
||||||
|
|
||||||
|
|
||||||
class Notification(BaseModel):
|
class Notification(BaseModel):
|
||||||
@@ -33,10 +33,14 @@ class Notification(BaseModel):
|
|||||||
self.send_notification_email()
|
self.send_notification_email()
|
||||||
|
|
||||||
sessions = self.to_user.user.session_set.all()
|
sessions = self.to_user.user.session_set.all()
|
||||||
|
avatar_image = UserProfile.get_default_avatar_image()
|
||||||
|
if self.from_user is not None:
|
||||||
|
avatar_image = self.from_user.get_avatar_image()
|
||||||
|
|
||||||
for session in sessions:
|
for session in sessions:
|
||||||
post_notification(
|
post_notification(
|
||||||
session.session_key,
|
session.session_key,
|
||||||
self.to_user.get_avatar_image(),
|
avatar_image,
|
||||||
self.notification_html)
|
self.notification_html)
|
||||||
|
|
||||||
return super(Notification, self).save(force_insert, force_update, using, update_fields)
|
return super(Notification, self).save(force_insert, force_update, using, update_fields)
|
||||||
|
|||||||
Reference in New Issue
Block a user