Skip to content

Commit

Permalink
adjusted regex errors
Browse files Browse the repository at this point in the history
  • Loading branch information
WillNovus committed Feb 25, 2025
1 parent d7ccfe4 commit a9b8497
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion margin_app/app/crud/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ async def create_user(self, wallet_id: str) -> User:
except IntegrityError as e:
await session.rollback()
if "unique constraint" in str(e).lower():
raise ValueError(f"Key (wallet_id)=({wallet_id}) already exists") from e
raise ValueError(f"{wallet_id} already exists") from e
raise

async def get_user(self, user_id: UUID, **kwargs) -> Optional[User]:
Expand Down
2 changes: 1 addition & 1 deletion margin_app/app/tests/test_user_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ async def test_create_user_duplicate_wallet_id(user_crud: UserCRUD) -> None:
wallet_id = "wallet_666"
await user_crud.create_user(wallet_id = wallet_id)
with pytest.raises(ValueError,
match=f"Key (wallet_id)=({wallet_id}) already exists"):
match=f"{wallet_id} already exists"):
await user_crud.create_user(wallet_id = wallet_id)
#----------------------------------------------------------------------------------

Expand Down

0 comments on commit a9b8497

Please sign in to comment.