diff --git a/notice/consumers.py b/notice/consumers.py index 02aca83..81e78b4 100644 --- a/notice/consumers.py +++ b/notice/consumers.py @@ -18,7 +18,7 @@ class NoticeManager: unsend_notices = NoticeModel.objects.filter(user=consumer.user) for notice in unsend_notices: - self.notify_user(consumer.user, json_data=notice.data) + consumer.send(notice.data) notice.delete() def remove(self, consumer: NoticeConsumer): @@ -29,9 +29,9 @@ class NoticeManager: if consumer.user == user: return consumer - def notify_user(self, user: User, data: dict = None, json_data: str = None): + def notify_user(self, user: User, data: dict): consumer = self.get_consumer_by_user(user) - data_str: str = json.dumps(data) if json_data is None else json_data + data_str: str = json.dumps(data) if consumer: consumer.send(data_str) else: