mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
🚨 auto fix by pre-commit hooks
This commit is contained in:
parent
2e664c387e
commit
05ca69bd4c
@ -26,6 +26,7 @@ class GroupInfoUser(Model):
|
||||
table = "group_info_users"
|
||||
table_description = "群员信息数据表"
|
||||
unique_together = ("user_id", "group_id")
|
||||
|
||||
_unicode_safe_fields = ["user_name", "nickname"] # noqa: RUF012
|
||||
|
||||
@classmethod
|
||||
|
||||
@ -3,7 +3,8 @@ import re
|
||||
|
||||
import nonebot
|
||||
from nonebot.utils import is_coroutine_callable
|
||||
from tortoise import BaseDBAsyncClient, Tortoise
|
||||
from tortoise import Tortoise
|
||||
from tortoise.backends.base.client import BaseDBAsyncClient
|
||||
from tortoise.connection import connections
|
||||
from tortoise.models import Model as Model_
|
||||
|
||||
@ -76,7 +77,7 @@ class UnicodeSafeMixin(Model_):
|
||||
return instance
|
||||
|
||||
@classmethod
|
||||
def filter(cls, *args, **kwargs): # pyright: ignore[reportIncompatibleMethodOverride]
|
||||
def filter(cls, *args, **kwargs): # pyright: ignore[reportIncompatibleMethodOverride]
|
||||
for field in cls._unicode_safe_fields:
|
||||
if field in kwargs and isinstance(kwargs[field], str):
|
||||
kwargs[field] = unicode_escape(kwargs[field])
|
||||
|
||||
Loading…
Reference in New Issue
Block a user