Skip to content

Commit

Permalink
Removed await from session.add and session.delete
Browse files Browse the repository at this point in the history
  • Loading branch information
Centurix committed Aug 17, 2023
1 parent c01817d commit 0b1934a
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/traffcap/repositories/inbound_request_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async def store_request(
endpoint_code,
request
)
await session.add(InboundRequestModel(**new_inbound_request.model_dump()))
session.add(InboundRequestModel(**new_inbound_request.model_dump()))
await session.commit()

@classmethod
Expand Down
4 changes: 2 additions & 2 deletions src/traffcap/repositories/rule_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async def get_all_rules(cls) -> List[Rule]:
async def create_rule(cls, rule: str = ".*") -> Optional[Rule]:
async with cls.session() as session:
new_rule = RuleModel(rule=rule)
await session.add(new_rule)
session.add(new_rule)
await session.commit()

return Rule.model_validate(
Expand All @@ -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:
await session.delete(
session.delete(
await session.get(RuleModel, rule_id)
)
await session.commit()
Expand Down
2 changes: 1 addition & 1 deletion src/traffcap/repositories/user_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class UserRepository(Repository):
async def add_a_test_user(cls) -> Optional[User]:
user = None
async with cls.session() as session:
await session.add(
session.add(
UserModel(
email="centurix@gmail.com",
fullname="Chris Read"
Expand Down
Binary file modified src/traffcap/spa/public/favicon.ico
Binary file not shown.
Binary file modified src/traffcap/spa/public/icons/favicon-128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/traffcap/spa/public/icons/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/traffcap/spa/public/icons/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/traffcap/spa/public/icons/favicon-96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0b1934a

Please sign in to comment.