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
2 changes: 1 addition & 1 deletion src/entrypoints/api/routers/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ async def create_profile(
legacy=dto.legacy,
)
except DuplicateProfileError as e:
raise HTTPException(status_code=400, detail=str(e))
raise HTTPException(status_code=409, detail=str(e))
except InvalidConfirmPasswordError as e:
raise HTTPException(status_code=400, detail=str(e))
except InvalidFormatEmailError as e:
Expand Down
4 changes: 2 additions & 2 deletions src/entrypoints/api/tests/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ async def test_06_user_cannot_update_roles(self, client):
)
assert r.status_code == 403

async def test_07_create_duplicate_user_profile_returns_400(self, client):
async def test_07_create_duplicate_user_profile_returns_409(self, client):
payload = {
"email": "alice@example.com",
"password": "Secret123!",
"confirm_password": "Secret123!",
"name": "Alice Dup"
}
r = await client.post("/profiles", json=payload)
assert r.status_code == 400
assert r.status_code == 409
assert "already exists" in r.json()["detail"].lower()

async def test_08_coach_cannot_update_user_profile(self, client):
Expand Down