From 789a3c0a9da9237b44915aaf9f0431bd7eb4555d Mon Sep 17 00:00:00 2001 From: bakatrouble Date: Wed, 12 Feb 2020 20:22:42 +0300 Subject: [PATCH] fix --- bots/modules/ping.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bots/modules/ping.py b/bots/modules/ping.py index efc95fd..9ecf0db 100644 --- a/bots/modules/ping.py +++ b/bots/modules/ping.py @@ -17,15 +17,15 @@ from bots.models import TelegramBotModuleConfig class PingBotCategory(models.Model): chat_id = models.BigIntegerField(db_index=True) cat_name = models.CharField(max_length=64, db_index=True) - user_ids = JSONField(default='[]') + user_ids = JSONField(null=True) def add_user(self, uid: int): - user_ids = set(self.user_ids) + user_ids = set(self.user_ids or []) user_ids.add(uid) self.user_ids = list(user_ids) def remove_user(self, uid: int): - user_ids = set(self.user_ids) + user_ids = set(self.user_ids or []) user_ids.add(uid) self.user_ids = list(user_ids)