From 91e95b19471fb7af56978e732b98a60f6bb0244f Mon Sep 17 00:00:00 2001 From: Finn Stutzenstein Date: Wed, 21 Oct 2026 09:06:51 +0000 Subject: [PATCH] Make isort compatible with black isort's lines_after_imports = 2 conflicted with black, so run-cleanup reverted black's changes. Use isort's black profile instead and apply the resulting formatting. Also fix the flake8 errors in check_email_mixin and drop a leftover debug print. Co-Authored-By: Claude Opus 5.5 --- max/auth/auth.py | 1 - max/auth/middlewares.py | 1 - max/csrf.py | 1 - max/routes/check_email_mixin.py | 3 +-- max/routes/favicon.py | 1 - max/translations.py | 1 - setup.cfg | 7 +------ 7 files changed, 2 insertions(+), 13 deletions(-) diff --git a/max/auth/auth.py b/max/auth/auth.py index 2dfeedf..774bd06 100644 --- a/max/auth/auth.py +++ b/max/auth/auth.py @@ -8,7 +8,6 @@ from max.crypto import constant_time_compare, force_bytes from max.db import get_user_by_email, update_user from max.translations import t - SSHA512_PREFIX = "{SSHA512}" diff --git a/max/auth/middlewares.py b/max/auth/middlewares.py index 95860b8..b07babc 100644 --- a/max/auth/middlewares.py +++ b/max/auth/middlewares.py @@ -9,7 +9,6 @@ from max.views import redirect from .auth import logout - DEBUG_DEFAULT_LOGIN = False diff --git a/max/csrf.py b/max/csrf.py index 1fd3506..e90c099 100644 --- a/max/csrf.py +++ b/max/csrf.py @@ -5,7 +5,6 @@ from flask import request, session from max.crypto import constant_time_compare, get_random_string from max.middlewares import BaseMiddleware - CSRF_TOKEN_KEY = "csrf_token" CSRF_TOKEN_LENGTH = 32 diff --git a/max/routes/check_email_mixin.py b/max/routes/check_email_mixin.py index 206acb1..aab694a 100644 --- a/max/routes/check_email_mixin.py +++ b/max/routes/check_email_mixin.py @@ -9,8 +9,7 @@ from max.translations import t class CheckEmailMixin: def is_email_valid(self, email: str): """Checks for the email being valid and that it has a valid domain.""" - regex = re.compile(f"^[a-zA-Z0-9+_-]+@({ '|'.join(get_domains()) })$") - print(regex, email) + regex = re.compile(f"^[a-zA-Z0-9+_-]+@({'|'.join(get_domains())})$") match = regex.match(email) if not match: flash(t("The email is not valid"), category="error") diff --git a/max/routes/favicon.py b/max/routes/favicon.py index 3faa6e5..be70025 100644 --- a/max/routes/favicon.py +++ b/max/routes/favicon.py @@ -6,7 +6,6 @@ from flask import current_app, send_from_directory from max.permissions import AllowAnyAccess from max.views import BaseView - FAVICON_FOLDER = "private_static/favicons" STATE_FAVICON_ATTR = "available_favicons" diff --git a/max/translations.py b/max/translations.py index 68c0b06..fd19360 100644 --- a/max/translations.py +++ b/max/translations.py @@ -2,7 +2,6 @@ import json import os import re - ACCEPT_LANGUAGE_HEADER_REGEX = re.compile(r"([a-zA-Z]{2,3})(-[a-zA-Z\-]+)?") diff --git a/setup.cfg b/setup.cfg index a65e7a3..4fae945 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,12 +2,7 @@ max_line_length = 96 [isort] -include_trailing_comma = true -multi_line_output = 3 -lines_after_imports = 2 +profile = black combine_as_imports = true -force_grid_wrap = 0 -use_parentheses = true -line_length = 88 known_first_party = max known_third_party = flask