From f0bdb3425e0a8a22c057efa84d7df508202a629d Mon Sep 17 00:00:00 2001 From: Youngbin Han Date: Sun, 20 Oct 2024 05:17:58 +0000 Subject: [PATCH] Fix import sorting with isort --- indico_payment_opencollective/__init__.py | 1 - indico_payment_opencollective/blueprint.py | 4 ++-- indico_payment_opencollective/controllers.py | 14 ++++++++------ indico_payment_opencollective/plugin.py | 12 +++++++----- tests/controllers_test.py | 9 ++++++--- 5 files changed, 23 insertions(+), 17 deletions(-) diff --git a/indico_payment_opencollective/__init__.py b/indico_payment_opencollective/__init__.py index 80198b4..dab142c 100644 --- a/indico_payment_opencollective/__init__.py +++ b/indico_payment_opencollective/__init__.py @@ -7,5 +7,4 @@ from indico.util.i18n import make_bound_gettext - _ = make_bound_gettext('payment_opencollective') diff --git a/indico_payment_opencollective/blueprint.py b/indico_payment_opencollective/blueprint.py index c48e108..26b514b 100644 --- a/indico_payment_opencollective/blueprint.py +++ b/indico_payment_opencollective/blueprint.py @@ -7,8 +7,8 @@ from indico.core.plugins import IndicoPluginBlueprint -from indico_payment_opencollective.controllers import RHOpenCollectivePostPaymentCallback - +from indico_payment_opencollective.controllers import \ + RHOpenCollectivePostPaymentCallback blueprint = IndicoPluginBlueprint( 'payment_opencollective', __name__, diff --git a/indico_payment_opencollective/controllers.py b/indico_payment_opencollective/controllers.py index 0c114f6..5099e1e 100644 --- a/indico_payment_opencollective/controllers.py +++ b/indico_payment_opencollective/controllers.py @@ -7,19 +7,21 @@ from flask import flash, redirect, request from flask_pluginengine import current_plugin -from werkzeug.exceptions import BadRequest -from gql import gql, Client +from gql import Client, gql from gql.transport.requests import RequestsHTTPTransport - from indico.modules.events.payment.models.transactions import TransactionAction -from indico.modules.events.payment.notifications import notify_amount_inconsistency +from indico.modules.events.payment.notifications import \ + notify_amount_inconsistency from indico.modules.events.payment.util import register_transaction -from indico.modules.events.registration.models.registrations import Registration +from indico.modules.events.registration.models.registrations import \ + Registration from indico.web.flask.util import url_for from indico.web.rh import RH +from werkzeug.exceptions import BadRequest from indico_payment_opencollective import _ -from indico_payment_opencollective.constants import OC_API_BASEURL, OC_GQL_ORDER_QUERY +from indico_payment_opencollective.constants import (OC_API_BASEURL, + OC_GQL_ORDER_QUERY) oc_tx_order_status_action_mapping = {'PAID': TransactionAction.complete, 'REJECTED': TransactionAction.reject, diff --git a/indico_payment_opencollective/plugin.py b/indico_payment_opencollective/plugin.py index 602891a..f95ac26 100644 --- a/indico_payment_opencollective/plugin.py +++ b/indico_payment_opencollective/plugin.py @@ -1,16 +1,18 @@ from flask_pluginengine import render_plugin_template -from wtforms.fields import StringField, BooleanField -from wtforms.validators import DataRequired, Optional - from indico.core.plugins import IndicoPlugin, url_for_plugin -from indico.modules.events.payment import (PaymentEventSettingsFormBase, PaymentPluginMixin, +from indico.modules.events.payment import (PaymentEventSettingsFormBase, + PaymentPluginMixin, PaymentPluginSettingsFormBase) from indico.util.string import remove_accents, str_to_ascii +from wtforms.fields import BooleanField, StringField +from wtforms.validators import DataRequired, Optional from indico_payment_opencollective import _ from indico_payment_opencollective.blueprint import blueprint -from indico_payment_opencollective.constants import OC_BASEURL, OC_STAGING_BASEURL +from indico_payment_opencollective.constants import (OC_BASEURL, + OC_STAGING_BASEURL) + class PluginSettingsForm(PaymentPluginSettingsFormBase): collective_slug = StringField(_('Collective Slug'), [Optional()], description=_('Slug for Collective on Open Collective')) diff --git a/tests/controllers_test.py b/tests/controllers_test.py index ec0281a..51f6ede 100644 --- a/tests/controllers_test.py +++ b/tests/controllers_test.py @@ -8,11 +8,14 @@ from unittest.mock import MagicMock import pytest -from indico.modules.events.payment.models.transactions import PaymentTransaction +from indico.modules.events.payment.models.transactions import \ + PaymentTransaction -from indico_payment_opencollective.controllers import RHOpenCollectivePostPaymentCallback +from indico_payment_opencollective.controllers import \ + RHOpenCollectivePostPaymentCallback from indico_payment_opencollective.plugin import OpenCollectivePaymentPlugin -from tests.constants import GQL_QUERY_RESULT_MOCK, GQL_QUERY_RESULT_MOCK_1, GQL_QUERY_RESULT_MOCK_2 +from tests.constants import (GQL_QUERY_RESULT_MOCK, GQL_QUERY_RESULT_MOCK_1, + GQL_QUERY_RESULT_MOCK_2) @pytest.mark.usefixtures('request_context')