Skip to content

Commit

Permalink
Fix type check errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Centurix committed Mar 31, 2024
1 parent 79f6d1f commit 0a653b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/traffcap/repositories/rule_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ async def create_rule(cls, rule: str = ".*") -> Optional[Rule]:
@classmethod
async def delete_rule_by_id(cls, rule_id: int) -> None:
async with cls.session() as session:
session.delete(
await session.delete(
await session.get(RuleModel, rule_id)
)
await session.commit()
Expand Down
5 changes: 3 additions & 2 deletions src/traffcap/server.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
from pathlib import Path
from typing import Dict, Any
import click
import logging
from traffcap.core import (
Expand Down Expand Up @@ -28,7 +29,7 @@
app = FastAPI()


def custom_openapi():
def custom_openapi() -> Dict[str, Any]:
if app.openapi_schema:
return app.openapi_schema

Expand All @@ -44,7 +45,7 @@ def custom_openapi():

return app.openapi_schema

app.openapi = custom_openapi
setattr(app, 'openapi', custom_openapi)


# Enable CORS from anywhere with anything
Expand Down

0 comments on commit 0a653b0

Please sign in to comment.