mirror of
https://github.com/Derpy-Leggies/OnlyLegs.git
synced 2025-01-01 12:26:13 +00:00
Linting
This commit is contained in:
parent
a4d19bf32a
commit
97119ced54
|
@ -76,13 +76,30 @@ def create_app(test_config=None):
|
|||
|
||||
@login_manager.unauthorized_handler
|
||||
def unauthorized():
|
||||
return render_template('error.html', error=401,
|
||||
msg='You are not authorized to view this page!!!!'), 401
|
||||
error = 401
|
||||
msg = 'You are not authorized to view this page!!!!'
|
||||
return render_template('error.html', error=error, msg=msg), error
|
||||
|
||||
# Load JS assets
|
||||
assets.register('js_pre', Bundle('js/pre/*.js', output='gen/pre_packed.js', depends='js/pre/*.js'))
|
||||
assets.register('js_post', Bundle('js/post/*.js', output='gen/post_packed.js', depends='js/pre/*.js'))
|
||||
assets.register('styles', Bundle('sass/*.sass', filters='libsass', output='gen/styles.css', depends='sass/**/*.sass'))
|
||||
js_pre = Bundle(
|
||||
'js/pre/*.js',
|
||||
output='gen/pre_packed.js',
|
||||
depends='js/pre/*.js'
|
||||
)
|
||||
js_post = Bundle(
|
||||
'js/post/*.js',
|
||||
output='gen/post_packed.js',
|
||||
depends='js/post/*.js'
|
||||
)
|
||||
styles = Bundle(
|
||||
'sass/*.sass',
|
||||
filters='libsass',
|
||||
output='gen/styles.css',
|
||||
depends='sass/**/*.sass'
|
||||
)
|
||||
|
||||
assets.register('js_pre', js_pre)
|
||||
assets.register('js_post', js_post)
|
||||
assets.register('styles', styles)
|
||||
|
||||
# Error handlers, if the error is not a HTTP error, return 500
|
||||
@app.errorhandler(Exception)
|
||||
|
|
|
@ -7,7 +7,7 @@ from uuid import uuid4
|
|||
import logging
|
||||
from datetime import datetime as dt
|
||||
|
||||
from flask import Blueprint, flash, redirect, request, url_for, abort, jsonify, session
|
||||
from flask import Blueprint, flash, redirect, request, url_for, abort, jsonify
|
||||
from werkzeug.security import check_password_hash, generate_password_hash
|
||||
|
||||
from flask_login import login_user, logout_user, login_required
|
||||
|
@ -34,7 +34,7 @@ def login():
|
|||
user = db_session.query(db.Users).filter_by(username=username).first()
|
||||
|
||||
if not user and not check_password_hash(user.password, password):
|
||||
logging.error('Login attempt from %s', username, request.remote_addr)
|
||||
logging.error('Login attempt from %s', request.remote_addr)
|
||||
error.append('Username or Password is incorrect!')
|
||||
|
||||
if error:
|
||||
|
|
|
@ -4,8 +4,7 @@ OnlyLegs - Database models and functions for SQLAlchemy
|
|||
import os
|
||||
import platformdirs
|
||||
|
||||
from sqlalchemy import (
|
||||
create_engine, Column, Integer, String, Boolean, DateTime, ForeignKey, PickleType)
|
||||
from sqlalchemy import create_engine, Column, Integer, String, DateTime, ForeignKey, PickleType
|
||||
from sqlalchemy.orm import declarative_base, relationship
|
||||
|
||||
from flask_login import UserMixin
|
||||
|
|
|
@ -26,7 +26,7 @@ class OnlyLegs(Application):
|
|||
return cfg
|
||||
|
||||
@staticmethod
|
||||
def prog(self): # pylint: disable=C0116, E0202
|
||||
def prog(): # pylint: disable=C0116, E0202
|
||||
return 'OnlyLegs'
|
||||
|
||||
def load(self):
|
||||
|
|
Loading…
Reference in a new issue