for i,j,k in cur.execute('select * from users where username=? and password=?',(username,password)):if k: session['user']=ireturnredirect("/home",code=302)else:returnrender_template('login.html',value='Account is pending for approval')
try:if request.form['confirmed']: cond=Trueexcept: cond=Falsewith sqlite3.connect("database.db")as con: cur = con.cursor() cur.execute('select * from users where username=?',(username,))if cur.fetchone():returnrender_template('index.html',value='User exists!!')else: cur.execute('insert into users values(?,?,?)',(username,password,cond)) con.commit()returnrender_template('index.html',value='Success!!')