Skip to content

Commit 35513e3

Browse files
Merge pull request #187 from python-discord/bump-motor
Bump Motor Version To 3.0.0
2 parents e0d7c46 + 2b83c25 commit 35513e3

File tree

6 files changed

+180
-284
lines changed

6 files changed

+180
-284
lines changed

backend/middleware.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import ssl
21
from motor.motor_asyncio import AsyncIOMotorClient
32
from starlette.requests import Request
43
from starlette.responses import JSONResponse
5-
from starlette.types import ASGIApp, Scope, Receive, Send
4+
from starlette.types import ASGIApp, Receive, Scope, Send
65

76
from backend.constants import DATABASE_URL, DOCS_PASSWORD, MONGO_DATABASE
87

@@ -15,7 +14,7 @@ def __init__(self, app: ASGIApp) -> None:
1514
async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
1615
client: AsyncIOMotorClient = AsyncIOMotorClient(
1716
DATABASE_URL,
18-
ssl_cert_reqs=ssl.CERT_NONE
17+
tlsAllowInvalidCertificates=True
1918
)
2019
db = client[MONGO_DATABASE]
2120
Request(scope).state.db = db

backend/models/discord_role.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class RoleTags(BaseModel):
1010
integration_id: typing.Optional[str]
1111
premium_subscriber: bool
1212

13-
def __init__(self, **data: typing.Any) -> None:
13+
def __init__(self, **data) -> None:
1414
"""
1515
Handle the terrible discord API.
1616

backend/models/form.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def validate_role(cls, values: dict[str, t.Any]) -> t.Optional[dict[str, t.Any]]
8989

9090
return values
9191

92-
def dict(self, admin: bool = True, **kwargs: t.Any) -> dict[str, t.Any]:
92+
def dict(self, admin: bool = True, **kwargs) -> dict[str, t.Any]:
9393
"""Wrapper for original function to exclude private data for public access."""
9494
data = super().dict(**kwargs)
9595

backend/route_manager.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
import importlib
66
import inspect
77
import typing as t
8-
98
from pathlib import Path
109

11-
from starlette.routing import Route as StarletteRoute, BaseRoute, Mount
1210
from nested_dict import nested_dict
11+
from starlette.routing import BaseRoute, Mount, Route as StarletteRoute
1312

1413
from backend.route import Route
1514

@@ -28,7 +27,7 @@ def construct_route_map_from_dict(route_dict: dict) -> list[BaseRoute]:
2827
return route_map
2928

3029

31-
def is_route_class(member: t.Any) -> bool:
30+
def is_route_class(member: t.Any) -> bool: # noqa: ANN401
3231
return inspect.isclass(member) and issubclass(member, Route) and member != Route
3332

3433

0 commit comments

Comments
 (0)