refactor: 更改系统消息初始化策略

This commit is contained in:
xinwen
2021-06-28 15:33:58 +08:00
committed by Jiangjie.Bai
parent c0ec0f1343
commit 732f0b55dc
3 changed files with 45 additions and 11 deletions

View File

@@ -32,16 +32,6 @@ class MessageType(type):
}
if issubclass(clz, SystemMessage):
system_msgs.append(msg)
try:
if not SystemMsgSubscription.objects.filter(message_type=message_type).exists():
sub = SystemMsgSubscription.objects.create(message_type=message_type)
clz.post_insert_to_db(sub)
except ProgrammingError as e:
if e.args[0] == 1146:
# 表不存在
pass
else:
raise
elif issubclass(clz, UserMessage):
user_msgs.append(msg)