From 0b8d08418157d20cd396fb319f524374971d1708 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Fri, 4 May 2018 10:35:32 +0200 Subject: [PATCH] Deal with pylint being pylint --- solvable/src/webservice/crypto.py | 4 ++-- solvable/src/webservice/server.py | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/solvable/src/webservice/crypto.py b/solvable/src/webservice/crypto.py index 9ccf1cf..057bb57 100644 --- a/solvable/src/webservice/crypto.py +++ b/solvable/src/webservice/crypto.py @@ -7,5 +7,5 @@ class PasswordHasher: return pbkdf2_sha256.hash(password) @staticmethod - def verify(password, hash): - return pbkdf2_sha256.verify(password, hash) + def verify(password, hashdigest): + return pbkdf2_sha256.verify(password, hashdigest) diff --git a/solvable/src/webservice/server.py b/solvable/src/webservice/server.py index 2348e13..cc84ecb 100644 --- a/solvable/src/webservice/server.py +++ b/solvable/src/webservice/server.py @@ -20,7 +20,7 @@ def get_db_session(): @app.teardown_appcontext -def close_db_session(error): +def close_db_session(err): # pylint: disable=unused-argument if hasattr(g, 'db_session'): g.db_session.close() @@ -30,7 +30,7 @@ def index(): if request.method == 'POST': try: UserOps(request.form.get('username'), - request.form.get('password'), + request.form.get('password'), get_db_session()).authenticate() except InvalidCredentialsError: return render_template('login.html', alert='Invalid credentials!') @@ -38,7 +38,7 @@ def index(): session['logged_in'] = True session['username'] = request.form['username'] return render_template('internal.html') - + if session.get('logged_in'): return render_template('internal.html') return render_template('login.html') @@ -80,7 +80,7 @@ def logout(): @app.errorhandler(401) @app.errorhandler(404) @app.route('/error') -def error(error): +def error(err): # pylint: disable=unused-argument return render_template('error.html', error=error), error.code @@ -89,7 +89,7 @@ def error(error): # for some bizarre reason @app.errorhandler(500) @app.route('/error') -def servererror(error): +def servererror(err): # pylint: disable=unused-argument return render_template('error.html', error='500: Internal server error'), 500