From 787af8b268942ed28518f81d17cab7c1645f8a89 Mon Sep 17 00:00:00 2001 From: emile Date: Tue, 1 Oct 2024 20:02:47 +0300 Subject: [PATCH] New --- .../__pycache__/models.cpython-310.pyc | Bin 11637 -> 11652 bytes osinaweb/osichat/models.py | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osinaweb/osichat/__pycache__/models.cpython-310.pyc b/osinaweb/osichat/__pycache__/models.cpython-310.pyc index 1c33fa26111187f5d3c421e9e8ecc6ccac2c5fb3..fbf663c3a973490925b047e55cb037de331af527 100644 GIT binary patch delta 498 zcmXw0O-lk%6n$^T8E4cnD@iO!h_Xg>(IyDm)ut9v6cv^W>1p<;tmm`{W(c9Ji+HpW ze?+tiLn_E<*&hgken1ce5iPpcY##UAGxywk&wPAl&o-^HWd#Ua3-(X3acP~8p8Da= zgqVe>JOj9d6HYza$%;t*Wv+6cr#Kqdxu114s2O#_l!gjDX8mtcfog!ME_D^=tLdJ~ z$O>_SFc-p2Osi3D0Shy|Mm=A__05r7+S6Q(hdsS(;Kv5u1IvvLivTkl8gR7Hd9T<) zPTAE+3;XX7P7oesA`??YQ@+}9+LTLXREATxu{LNq3ZLHqVvq>MBibGPEA6zn(OyX&kI5kw=|L6Xr)baU|{1QARQUL+7mz#w6<$B_nI?CBuN3?j)b z>_M8GWRLy;5j@BSMGyK1ya+kv2Lu8+C4{^;Cf#&V-Bn$$oA>eU&n3U@`&EXcIq`cn zJ@WS-?s~YRHIFMhN649A0t!$DF%F!4Fbg9$10=?~_c)L;TlHBg~Qw6}G~S zWGh@xvaFRRq3%AKnYLws2H7CEPcTOC03jZbpNWqk+`4I^T1rWIf;$~VZ$@KJJ|mg@ zOZERX-<3u6r)a^fgQahxhG&2S26(^ppJ)wEkJIt50B8C|yjMG;`xgY;I-VLeWKVyO zhoPrmRt9x*tfHgGCqq}LF9SB{u3G`nlvkz4eez@Y8ub;@skt5tU=SxduJyp=g!6^c SFZJByw_1-VrJ>ZEdi@t=HG@R} 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