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 <noreply@anthropic.com>
This commit is contained in:
1 parent
340006ff37
commit
91e95b1947
7 files changed
+2
-13
No files matched your search
@@ -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.db import get_user_by_email, update_user
|
||||||
from max.translations import t
|
from max.translations import t
|
||||||
|
|
||||||
|
|
||||||
SSHA512_PREFIX = "{SSHA512}"
|
SSHA512_PREFIX = "{SSHA512}"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ from max.views import redirect
|
|||||||
|
|
||||||
from .auth import logout
|
from .auth import logout
|
||||||
|
|
||||||
|
|
||||||
DEBUG_DEFAULT_LOGIN = False
|
DEBUG_DEFAULT_LOGIN = False
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ from flask import request, session
|
|||||||
from max.crypto import constant_time_compare, get_random_string
|
from max.crypto import constant_time_compare, get_random_string
|
||||||
from max.middlewares import BaseMiddleware
|
from max.middlewares import BaseMiddleware
|
||||||
|
|
||||||
|
|
||||||
CSRF_TOKEN_KEY = "csrf_token"
|
CSRF_TOKEN_KEY = "csrf_token"
|
||||||
CSRF_TOKEN_LENGTH = 32
|
CSRF_TOKEN_LENGTH = 32
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,7 @@ from max.translations import t
|
|||||||
class CheckEmailMixin:
|
class CheckEmailMixin:
|
||||||
def is_email_valid(self, email: str):
|
def is_email_valid(self, email: str):
|
||||||
"""Checks for the email being valid and that it has a valid domain."""
|
"""Checks for the email being valid and that it has a valid domain."""
|
||||||
regex = re.compile(f"^[a-zA-Z0-9+_-]+@({ '|'.join(get_domains()) })$")
|
regex = re.compile(f"^[a-zA-Z0-9+_-]+@({'|'.join(get_domains())})$")
|
||||||
print(regex, email)
|
|
||||||
match = regex.match(email)
|
match = regex.match(email)
|
||||||
if not match:
|
if not match:
|
||||||
flash(t("The email is not valid"), category="error")
|
flash(t("The email is not valid"), category="error")
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ from flask import current_app, send_from_directory
|
|||||||
from max.permissions import AllowAnyAccess
|
from max.permissions import AllowAnyAccess
|
||||||
from max.views import BaseView
|
from max.views import BaseView
|
||||||
|
|
||||||
|
|
||||||
FAVICON_FOLDER = "private_static/favicons"
|
FAVICON_FOLDER = "private_static/favicons"
|
||||||
STATE_FAVICON_ATTR = "available_favicons"
|
STATE_FAVICON_ATTR = "available_favicons"
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import json
|
|||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
|
||||||
ACCEPT_LANGUAGE_HEADER_REGEX = re.compile(r"([a-zA-Z]{2,3})(-[a-zA-Z\-]+)?")
|
ACCEPT_LANGUAGE_HEADER_REGEX = re.compile(r"([a-zA-Z]{2,3})(-[a-zA-Z\-]+)?")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,12 +2,7 @@
|
|||||||
max_line_length = 96
|
max_line_length = 96
|
||||||
|
|
||||||
[isort]
|
[isort]
|
||||||
include_trailing_comma = true
|
profile = black
|
||||||
multi_line_output = 3
|
|
||||||
lines_after_imports = 2
|
|
||||||
combine_as_imports = true
|
combine_as_imports = true
|
||||||
force_grid_wrap = 0
|
|
||||||
use_parentheses = true
|
|
||||||
line_length = 88
|
|
||||||
known_first_party = max
|
known_first_party = max
|
||||||
known_third_party = flask
|
known_third_party = flask
|
||||||
Reference in new issue
Block a user