diff --git a/osinaweb/osichat/__pycache__/models.cpython-310.pyc b/osinaweb/osichat/__pycache__/models.cpython-310.pyc index 1c33fa26..fbf663c3 100644 Binary files a/osinaweb/osichat/__pycache__/models.cpython-310.pyc and b/osinaweb/osichat/__pycache__/models.cpython-310.pyc differ diff --git a/osinaweb/osichat/models.py b/osinaweb/osichat/models.py index b1341a6f..8427f721 100644 --- a/osinaweb/osichat/models.py +++ b/osinaweb/osichat/models.py @@ -305,9 +305,8 @@ class ChatMessage(models.Model): self.send_message_notification() def send_message_notification(self): type_id = self.room.id - chatroom_guest = getattr(self.room, 'chatroomguest', None) - if chatroom_guest: + if self.room.chatroomguest: session_id = self.room.chatroomguest.visitor.session_id notification = ChatNotification.objects.create( title=f"Visitor {self.room.chatroomguest.visitor.ip_address} sent a new message on Ositcom!", @@ -325,6 +324,7 @@ class ChatMessage(models.Model): notification = ChatNotification.objects.create( title=f"New message from {self.member.first_name} {self.member.last_name}!", message= f"{self.content}", + image = user.staffprofile.image.url if user.staffprofile and user.staffprofile.image else None, type="Chat", type_id=self.room.id, user=user