mercredi 12 août 2020

If statement takes too much time after calling stored procedure

This stored procedure works fine in other project but here I had to restart app to get to other page. Am I calling it wrong ?

If I comment where I call procedure and check password like 'if not user or '1234' == passw:' it works fine but the way below it takes forever.

@app.route('/logmein', methods=['GET', 'POST'])
def logmein():
    username = request.args.get('inemail')
    passw = request.args.get('inpassword')
    user = Kullanici.query.filter_by(Eposta=username).first()
    
    result = conn.execute('IsPasswordCorrect "%s","%s",%s,%s,%s' %(username, passw, '0', '0', '0'))
    passc = [i[0] for i in result]

    if not user or not passc[0] > 0:
        flash('Wrong Username / Wrong Password')
        return redirect(url_for('login'))

    login_user(user)
    session.permanent = True


    return redirect('/admin')

Aucun commentaire:

Enregistrer un commentaire