From 3340b77efe43a1a953f05e71f2d2b470711081fb Mon Sep 17 00:00:00 2001 From: Christoph Urlacher Date: Fri, 30 Aug 2024 18:48:40 +0200 Subject: [PATCH] Slight reformatting --- formula10/__init__.py | 10 +++++----- formula10/controller/race_controller.py | 2 +- formula10/openf1/model/api_session.py | 4 +++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/formula10/__init__.py b/formula10/__init__.py index bdd751b..7616597 100644 --- a/formula10/__init__.py +++ b/formula10/__init__.py @@ -9,12 +9,12 @@ if not ENABLE_TIMING: print("- Disabled timing constraints") app: Flask = Flask(__name__) -app.config['SQLALCHEMY_DATABASE_URI'] = "sqlite:///formula10.db" -app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False +app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///formula10.db" +app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False # Session cookie is used to propagate message to error page -app.config['SESSION_TYPE'] = 'memcached' -app.config['SECRET_KEY'] = 'ich stinke nach maggi' +app.config["SESSION_TYPE"] = "memcached" +app.config["SECRET_KEY"] = "ich stinke nach maggi" app.url_map.strict_slashes = False @@ -49,4 +49,4 @@ import formula10.controller.error_controller # General # - Adapt diagram colors to team colors # - Add links to the official F1 stats page (for quali/result), probably best to store entire link in DB (because they are not entirely regular)? -# - Unit testing (as much as possible, but especially points calculation) \ No newline at end of file +# - Unit testing (as much as possible, but especially points calculation) diff --git a/formula10/controller/race_controller.py b/formula10/controller/race_controller.py index cf776dd..f4bce01 100644 --- a/formula10/controller/race_controller.py +++ b/formula10/controller/race_controller.py @@ -51,4 +51,4 @@ def race_guess_delete_post(race_name: str, user_name: str) -> Response: race_id: int = Model().race_by(race_name=race_name).id user_id: int = Model().user_by(user_name=user_name).id - return delete_race_guess(race_id, user_id) \ No newline at end of file + return delete_race_guess(race_id, user_id) diff --git a/formula10/openf1/model/api_session.py b/formula10/openf1/model/api_session.py index ab0374c..0f59889 100644 --- a/formula10/openf1/model/api_session.py +++ b/formula10/openf1/model/api_session.py @@ -20,6 +20,8 @@ class ApiSession(): "year": int } + + def __init__(self, response: dict[str, str] | None): if response is None: return @@ -55,4 +57,4 @@ class ApiSession(): gmt_offset: time = None # type: ignore session_key: int = None # type: ignore meeting_key: int = None # type: ignore - year: int = None # type: ignore \ No newline at end of file + year: int = None # type: ignore