fix: notice anonymous user

This commit is contained in:
AdrienLSH 2024-05-15 16:41:51 +02:00
parent 6bc7270dfb
commit 71c313a078

View File

@ -26,9 +26,10 @@ class NoticeManager:
'user': ProfileSerializer(consumer.user.profilemodel).data})
def remove(self, consumer: NoticeConsumer):
for friend in consumer.user.profilemodel.get_friends():
self.notify_user(friend.user, {'type': 'offline',
'user': ProfileSerializer(consumer.user.profilemodel).data})
if consumer.user.is_authenticated:
for friend in consumer.user.profilemodel.get_friends():
self.notify_user(friend.user, {'type': 'offline',
'user': ProfileSerializer(consumer.user.profilemodel).data})
self._list.remove(consumer)
def get_consumer_by_user(self, user: User):