Fix __init__ file

Style code with Black
This commit is contained in:
Michał Gdula 2023-05-09 16:46:12 +03:00
parent e7bbb02aba
commit dcc9247ba0
8 changed files with 84 additions and 62 deletions

View file

@ -2,22 +2,23 @@ from flask import Blueprint, request, render_template
from server.models import Scores
blueprint = Blueprint('views', __name__)
blueprint = Blueprint("views", __name__)
@blueprint.route('/')
@blueprint.route("/")
# @cache.cached(timeout=60)
def index():
difficulty = request.args.get('diff', 0)
difficulty = request.args.get("diff", 0)
top_scores = (Scores.query
.order_by(Scores.score.desc())
.filter_by(difficulty=difficulty)
.limit(10)
.all())
return render_template('scores.html', top_scores=top_scores)
top_scores = (
Scores.query.order_by(Scores.score.desc())
.filter_by(difficulty=difficulty)
.limit(10)
.all()
)
return render_template("scores.html", top_scores=top_scores)
@blueprint.route('/about')
@blueprint.route("/about")
def about():
return render_template('about.html')
return render_template("about.html")