style: fix ruff formatting in bracket_view and routes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+18
-3
@@ -67,9 +67,24 @@ def build_bracket_view(year, bracket_payload, fetched_at=None):
|
||||
"west_cf": west_cf,
|
||||
"cup": cup,
|
||||
"rounds": [
|
||||
{"label": ROUND_LABELS[1], "round_num": 1, "east": east_r1, "west": west_r1},
|
||||
{"label": ROUND_LABELS[2], "round_num": 2, "east": east_r2, "west": west_r2},
|
||||
{"label": ROUND_LABELS[3], "round_num": 3, "east": east_cf, "west": west_cf},
|
||||
{
|
||||
"label": ROUND_LABELS[1],
|
||||
"round_num": 1,
|
||||
"east": east_r1,
|
||||
"west": west_r1,
|
||||
},
|
||||
{
|
||||
"label": ROUND_LABELS[2],
|
||||
"round_num": 2,
|
||||
"east": east_r2,
|
||||
"west": west_r2,
|
||||
},
|
||||
{
|
||||
"label": ROUND_LABELS[3],
|
||||
"round_num": 3,
|
||||
"east": east_cf,
|
||||
"west": west_cf,
|
||||
},
|
||||
{"label": ROUND_LABELS[4], "round_num": 4, "cup": cup},
|
||||
],
|
||||
}
|
||||
|
||||
+14
-3
@@ -2,7 +2,14 @@ import json
|
||||
import logging
|
||||
|
||||
import requests as http_requests
|
||||
from flask import abort, make_response, render_template, jsonify, request, send_from_directory
|
||||
from flask import (
|
||||
abort,
|
||||
make_response,
|
||||
render_template,
|
||||
jsonify,
|
||||
request,
|
||||
send_from_directory,
|
||||
)
|
||||
|
||||
from app import APP_VERSION, app, static_v
|
||||
from app.config import SCOREBOARD_DATA_FILE
|
||||
@@ -93,13 +100,17 @@ def get_scoreboard():
|
||||
return jsonify({"error": "Invalid date format. Use YYYY-MM-DD."}), 400
|
||||
scoreboard_data = _fetch_date(date_param)
|
||||
if not scoreboard_data:
|
||||
return jsonify({"error": "Failed to retrieve scoreboard data for that date."})
|
||||
return jsonify(
|
||||
{"error": "Failed to retrieve scoreboard data for that date."}
|
||||
)
|
||||
else:
|
||||
try:
|
||||
with open(SCOREBOARD_DATA_FILE, "r") as json_file:
|
||||
scoreboard_data = json.load(json_file)
|
||||
except FileNotFoundError:
|
||||
return jsonify({"error": "Failed to retrieve scoreboard data. File not found."})
|
||||
return jsonify(
|
||||
{"error": "Failed to retrieve scoreboard data. File not found."}
|
||||
)
|
||||
except json.JSONDecodeError:
|
||||
return jsonify(
|
||||
{"error": "Failed to retrieve scoreboard data. Invalid JSON format."}
|
||||
|
||||
Reference in New Issue
Block a user