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 = "group_info_users"
|
||||||
table_description = "群员信息数据表"
|
table_description = "群员信息数据表"
|
||||||
unique_together = ("user_id", "group_id")
|
unique_together = ("user_id", "group_id")
|
||||||
|
|
||||||
_unicode_safe_fields = ["user_name", "nickname"] # noqa: RUF012
|
_unicode_safe_fields = ["user_name", "nickname"] # noqa: RUF012
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
@ -3,7 +3,8 @@ import re
|
|||||||
|
|
||||||
import nonebot
|
import nonebot
|
||||||
from nonebot.utils import is_coroutine_callable
|
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.connection import connections
|
||||||
from tortoise.models import Model as Model_
|
from tortoise.models import Model as Model_
|
||||||
|
|
||||||
@ -76,7 +77,7 @@ class UnicodeSafeMixin(Model_):
|
|||||||
return instance
|
return instance
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def filter(cls, *args, **kwargs): # pyright: ignore[reportIncompatibleMethodOverride]
|
def filter(cls, *args, **kwargs): # pyright: ignore[reportIncompatibleMethodOverride]
|
||||||
for field in cls._unicode_safe_fields:
|
for field in cls._unicode_safe_fields:
|
||||||
if field in kwargs and isinstance(kwargs[field], str):
|
if field in kwargs and isinstance(kwargs[field], str):
|
||||||
kwargs[field] = unicode_escape(kwargs[field])
|
kwargs[field] = unicode_escape(kwargs[field])
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user