From 284b41097b6db790a46765f3cb19c5b0e8e5150d Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Tue, 28 Dec 2021 13:35:00 +0800 Subject: [PATCH] :bug: fix pydantic error --- src/plugins/nonebot_plugin_sentry/config.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/plugins/nonebot_plugin_sentry/config.py b/src/plugins/nonebot_plugin_sentry/config.py index 346e1f8..c93e2da 100644 --- a/src/plugins/nonebot_plugin_sentry/config.py +++ b/src/plugins/nonebot_plugin_sentry/config.py @@ -4,7 +4,7 @@ @Author : yanyongyu @Date : 2020-11-23 18:44:18 @LastEditors : yanyongyu -@LastEditTime : 2021-06-10 23:48:15 +@LastEditTime : 2021-12-28 13:33:59 @Description : None @GitHub : https://github.com/yanyongyu """ @@ -26,21 +26,19 @@ class Config(BaseSettings): sentry_max_breadcrumbs: int = 100 sentry_attach_stacktrace: bool = False sentry_send_default_pii: bool = False - sentry_in_app_include: List[str] = Field(default_factory=lambda: []) - sentry_in_app_exclude: List[str] = Field(default_factory=lambda: []) + sentry_in_app_include: List[str] = Field(default_factory=list) + sentry_in_app_exclude: List[str] = Field(default_factory=list) sentry_request_bodies: str = "medium" sentry_with_locals: bool = True sentry_ca_certs: Optional[str] = None sentry_before_send: Optional[Callable[[Any, Any], Optional[Any]]] = None - sentry_before_breadcrumb: Optional[ - Callable[[Any, Any], Optional[Any]] - ] = None + sentry_before_breadcrumb: Optional[Callable[[Any, Any], Optional[Any]]] = None sentry_transport: Optional[Any] = None sentry_http_proxy: Optional[str] = None sentry_https_proxy: Optional[str] = None sentry_shutdown_timeout: int = 2 - @validator("sentry_dsn") + @validator("sentry_dsn", allow_reuse=True) def validate_dsn(cls, v): if not v: logger.warning("Sentry DSN not provided! Sentry plugin disabled!")