fix: notice anonymous user
This commit is contained in:
parent
6bc7270dfb
commit
71c313a078
@ -26,9 +26,10 @@ class NoticeManager:
|
|||||||
'user': ProfileSerializer(consumer.user.profilemodel).data})
|
'user': ProfileSerializer(consumer.user.profilemodel).data})
|
||||||
|
|
||||||
def remove(self, consumer: NoticeConsumer):
|
def remove(self, consumer: NoticeConsumer):
|
||||||
for friend in consumer.user.profilemodel.get_friends():
|
if consumer.user.is_authenticated:
|
||||||
self.notify_user(friend.user, {'type': 'offline',
|
for friend in consumer.user.profilemodel.get_friends():
|
||||||
'user': ProfileSerializer(consumer.user.profilemodel).data})
|
self.notify_user(friend.user, {'type': 'offline',
|
||||||
|
'user': ProfileSerializer(consumer.user.profilemodel).data})
|
||||||
self._list.remove(consumer)
|
self._list.remove(consumer)
|
||||||
|
|
||||||
def get_consumer_by_user(self, user: User):
|
def get_consumer_by_user(self, user: User):
|
||||||
|
Loading…
Reference in New Issue
Block a user