Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions backend/app/api/routes/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def recover_password(email: str, session: SessionDep) -> Message:
if not user:
raise HTTPException(
status_code=404,
detail="The user with this username does not exist in the system.",
detail="The user with this email does not exist in the system.",
)
password_reset_token = generate_password_reset_token(email=email)
email_data = generate_reset_password_email(
Expand All @@ -87,7 +87,7 @@ def reset_password(session: SessionDep, body: NewPassword) -> Message:
if not user:
raise HTTPException(
status_code=404,
detail="The user with this username does not exist in the system.",
detail="The user with this email does not exist in the system.",
)
elif not user.is_active:
raise HTTPException(status_code=400, detail="Inactive user")
Expand Down
6 changes: 3 additions & 3 deletions backend/app/api/routes/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def create_user(*, session: SessionDep, user_in: UserCreate) -> Any:
if user:
raise HTTPException(
status_code=400,
detail="The user with this username already exists in the system.",
detail="The user with this email already exists in the system.",
)

user = crud.create_user(session=session, user_create=user_in)
Expand Down Expand Up @@ -130,7 +130,7 @@ def create_user_open(session: SessionDep, user_in: UserCreateOpen) -> Any:
if user:
raise HTTPException(
status_code=400,
detail="The user with this username already exists in the system",
detail="The user with this email already exists in the system",
)
user_create = UserCreate.from_orm(user_in)
user = crud.create_user(session=session, user_create=user_create)
Expand Down Expand Up @@ -174,7 +174,7 @@ def update_user(
if db_user is None:
raise HTTPException(
status_code=404,
detail="The user with this username does not exist in the system",
detail="The user with this id does not exist in the system",
)
return db_user

Expand Down
8 changes: 2 additions & 6 deletions backend/app/tests/api/routes/test_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,7 @@ def test_create_user_open_already_exists_error(
json=data,
)
assert r.status_code == 400
assert (
r.json()["detail"] == "The user with this username already exists in the system"
)
assert r.json()["detail"] == "The user with this email already exists in the system"


def test_update_user(
Expand Down Expand Up @@ -329,9 +327,7 @@ def test_update_user_not_exists(
json=data,
)
assert r.status_code == 404
assert (
r.json()["detail"] == "The user with this username does not exist in the system"
)
assert r.json()["detail"] == "The user with this id does not exist in the system"


def test_delete_user_super_user(
Expand Down