From 68699223386e0cdcfb76521e9f91c7f8560b546d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 11 Dec 2021 17:58:45 +0100 Subject: [PATCH] Follow isort formatting issue10928 --- .isort.cfg | 3 +++ __init__.py | 5 ++--- ir.py | 2 +- party.py | 2 +- setup.py | 3 ++- tests/test_web_user.py | 11 +++++------ user.py | 13 ++++++------- 7 files changed, 20 insertions(+), 19 deletions(-) create mode 100644 .isort.cfg diff --git a/.isort.cfg b/.isort.cfg new file mode 100644 index 0000000000..e1c6495da9 --- /dev/null +++ b/.isort.cfg @@ -0,0 +1,3 @@ +[settings] +multi_line_output=4 +known_first_party=trytond diff --git a/__init__.py b/__init__.py index bfcfa271b8..3d065429f8 100644 --- a/__init__.py +++ b/__init__.py @@ -2,9 +2,8 @@ # this repository contains the full copyright notices and license terms. from trytond.pool import Pool -from . import user -from . import party -from . import ir + +from . import ir, party, user def register(): diff --git a/ir.py b/ir.py index 90d86ce07f..0882411411 100644 --- a/ir.py +++ b/ir.py @@ -1,6 +1,6 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import PoolMeta, Pool +from trytond.pool import Pool, PoolMeta from trytond.tools import escape_wildcard diff --git a/party.py b/party.py index e97d2b6dc9..a58d6c5384 100644 --- a/party.py +++ b/party.py @@ -1,6 +1,6 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import PoolMeta, Pool +from trytond.pool import Pool, PoolMeta class Replace(metaclass=PoolMeta): diff --git a/setup.py b/setup.py index 7f3bd44922..96f99cad70 100755 --- a/setup.py +++ b/setup.py @@ -6,7 +6,8 @@ import io import os import re from configparser import ConfigParser -from setuptools import setup, find_packages + +from setuptools import find_packages, setup def read(fname): diff --git a/tests/test_web_user.py b/tests/test_web_user.py index 10e003a2d2..374c2a722d 100644 --- a/tests/test_web_user.py +++ b/tests/test_web_user.py @@ -2,16 +2,15 @@ # this repository contains the full copyright notices and license terms. import unittest +from unittest.mock import ANY, patch -from unittest.mock import patch, ANY - -from trytond.tests.test_tryton import ModuleTestCase, with_transaction -from trytond.tests.test_tryton import suite as test_suite -from trytond.pool import Pool from trytond.config import config - from trytond.modules.party.tests import PartyCheckEraseMixin from trytond.modules.web_user import user as user_module +from trytond.pool import Pool +from trytond.tests.test_tryton import ModuleTestCase +from trytond.tests.test_tryton import suite as test_suite +from trytond.tests.test_tryton import with_transaction VALIDATION_URL = 'http://www.example.com/validation' RESET_PASSWORD_URL = 'http://www.example.com/reset_password' diff --git a/user.py b/user.py index 1a2d3a76fa..61c3ec326d 100644 --- a/user.py +++ b/user.py @@ -25,18 +25,17 @@ from sql.operators import Equal from trytond.config import config from trytond.exceptions import RateLimitException +from trytond.ir.session import token_hex from trytond.model import ( - ModelView, ModelSQL, DeactivableMixin, fields, Unique, Exclude, - avatar_mixin) + DeactivableMixin, Exclude, ModelSQL, ModelView, Unique, avatar_mixin, + fields) from trytond.pool import Pool from trytond.pyson import Eval from trytond.report import Report, get_email -from trytond.transaction import Transaction -from trytond.tools.email_ import set_from_header +from trytond.res.user import CRYPT_CONTEXT, LoginAttempt from trytond.sendmail import sendmail_transactional - -from trytond.ir.session import token_hex -from trytond.res.user import LoginAttempt, CRYPT_CONTEXT +from trytond.tools.email_ import set_from_header +from trytond.transaction import Transaction logger = logging.getLogger(__name__)