I tried return redirect for create users, and it was working fine until I wrote an if statement that only redirected to the home page if I was logged in. I'm not getting these two errors: sqlite3.OperationalError: database is locked and sqlite3.IntegrityError: UNIQUE constraint failed: users.username. Also, I tried changing it to my original code that was return response which successfully displayed a message before if the username was already in the data base. It doesn't do that anymore and also throws me these errors. I tried changing insert into users to insert or replace into users, but I realized this doesn't give the user a message anymore if there already exists someone with the username.
I was wondering what these errors mean and if you have any tips?
Hi Mike,
I tried
return redirect
for create users, and it was working fine until I wrote an if statement that only redirected to the home page if I was logged in. I'm not getting these two errors:sqlite3.OperationalError: database is locked
andsqlite3.IntegrityError: UNIQUE constraint failed: users.username
. Also, I tried changing it to my original code that wasreturn response
which successfully displayed a message before if the username was already in the data base. It doesn't do that anymore and also throws me these errors. I tried changinginsert into users
toinsert or replace into users
, but I realized this doesn't give the user a message anymore if there already exists someone with the username.I was wondering what these errors mean and if you have any tips?