mirror of
https://github.com/avatao-content/test-tutorial-framework
synced 2024-11-14 15:37:18 +00:00
Deal with pylint being pylint
This commit is contained in:
parent
6782b49882
commit
0b8d084181
@ -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)
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user