Skip to content

Commit

Permalink
✨ add pydantic v2 support
Browse files Browse the repository at this point in the history
  • Loading branch information
StarHeartHunt committed Feb 29, 2024
1 parent e718a20 commit a4dbb76
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions nonebot_plugin_shorturl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
from nonebot.drivers import ASGIMixin
from nonebot.plugin import PluginMetadata
from fastapi.responses import RedirectResponse
from nonebot import logger, get_app, get_driver
from nonebot import logger, get_app, get_driver, get_plugin_config

from .config import Config

driver = get_driver()
plugin_config = Config.parse_obj(driver.config)
plugin_config = get_plugin_config(Config)

from .provider import get_provider
from .provider import ShortURL as ShortURL
Expand Down
2 changes: 1 addition & 1 deletion nonebot_plugin_shorturl/provider/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@ async def to_url(self) -> str:
token = await get_provider().store(self.url)

return urljoin(
plugin_config.shorturl_host,
str(plugin_config.shorturl_host),
plugin_config.shorturl_endpoint.format(token=token),
)

0 comments on commit a4dbb76

Please sign in to comment.