diff --git a/margin_app/app/crud/user.py b/margin_app/app/crud/user.py index 0a659b5b..836ae0f3 100644 --- a/margin_app/app/crud/user.py +++ b/margin_app/app/crud/user.py @@ -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]: diff --git a/margin_app/app/tests/test_user_crud.py b/margin_app/app/tests/test_user_crud.py index 0204846b..389d453d 100644 --- a/margin_app/app/tests/test_user_crud.py +++ b/margin_app/app/tests/test_user_crud.py @@ -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) #----------------------------------------------------------------------------------