Skip to content

Commit 66303aa

Browse files
committed
fix: mypy error
1 parent 77697fa commit 66303aa

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed

api/src/authentication/models.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,6 @@ def check_privilege(self, required_level: "AccessLevel") -> bool:
1515
return True
1616
return False
1717

18-
@classmethod
19-
def __get_validators__(cls): # type:ignore
20-
yield cls.validate
21-
22-
@classmethod
23-
def validate(cls, v: str) -> "AccessLevel":
24-
if isinstance(v, cls):
25-
return v
26-
try:
27-
return cls[v]
28-
except KeyError:
29-
raise ValueError("invalid AccessLevel enum value ")
30-
3118
@classmethod
3219
def __get_pydantic_json_schema__(
3320
cls, core_schema: core_schema.CoreSchema, handler: GetJsonSchemaHandler

api/src/common/exception_handlers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def add_exception_handlers(app: FastAPI) -> None:
3030

3131
# Override built-in default handler
3232
app.add_exception_handler(RequestValidationError, validation_exception_handler) # type: ignore
33-
app.add_exception_handler(HTTPStatusError, http_exception_handler) # type: ignore
33+
app.add_exception_handler(HTTPStatusError, http_exception_handler)
3434

3535
# Fallback exception handler for all unexpected exceptions
3636
app.add_exception_handler(Exception, fall_back_exception_handler)

0 commit comments

Comments
 (0)