I passed all test except one. ":( registration rejects duplicate username" (picture below)

error message


However I get the correct error message (400) in terminal when try to use username that is already taken. enter image description here

Any suggestion or ideas?

1 Answer 1



After testing website with Postman I found my mistake.

After a successful registration I was logging user in automatically (saving session["user_id"] = result and redirecting to index.html). If second POST request was sent using the same username, user was redirected to the homepage (index.html) resulting in response code 200 (and failed check50 test).

It seems that check50 test expects you to render the same registration.html page after successful registration or allow logged-in user to register. In staff solution (http://finance.cs50.net/) user is automatically redirected, but http://finance.cs50.net/register can be accessed even after logging-in.

  • Can you tell me how you got the last one "cannot find 9,944 on the page" Mar 6, 2018 at 15:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .