@app.route('/login/admin/', methods=['GET', 'POST'])
def login_admin():
    """Login screen for application"""

    next = request.args.get('next',url_for('admin.index'))

    if request.method == 'GET':
        return render_template('login_admin.html', next=next)
    if request.method == 'POST' and request.form in 'username':
        username = request.form['username']
        hashed = unicode(new_hash("sha", request.form['password'].encode('utf8')).hexdigest())
        user = LabManagerUser.exists(username, hashed)
        if user is not None:
            if login_user(user):
                session['loggeduser'] = username
                session['last_request'] = time()
                session['usertype'] = 'labmanager'
                next = request.args.get('next', url_for('admin.index'))
                return redirect(next)
            else:
                flash(gettext(u'Could not log in.'))
                return render_template('login_admin.html', next=next)
        else:
            flash(gettext(u'Invalid username.'))
            return render_template('login_admin.html', next=next)
    return gettext("Error in create_session")
dataset/ETHPy150Open gateway4labs/labmanager/labmanager/views/authn.py/login_admin/swapped operands of `in`