mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-04 02:31:27 +00:00
fix(e2e/ui): match the 409 duplicate-user status in the ensure fallback
/user/new raises 409 for an existing user, not 400, so the update fallback was unreachable and any rerun against an already-seeded DB would fail setup. Accept either status and let the already-exists body check discriminate
This commit is contained in:
parent
462f3d8435
commit
39e2b6d0ad
1 changed files with 1 additions and 1 deletions
|
|
@ -24,7 +24,7 @@ async function ensureDbRoleUser(
|
|||
});
|
||||
if (created.ok()) return;
|
||||
const body = await created.text();
|
||||
if (created.status() === 400 && body.includes("already exists")) {
|
||||
if ((created.status() === 409 || created.status() === 400) && body.includes("already exists")) {
|
||||
const updated = await api.post(`${baseUrl}/user/update`, {
|
||||
headers: auth,
|
||||
data: { user_id: entry.userId, user_role: entry.dbRole, password },
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue