diff --git a/authentication/middleware.py b/authentication/middleware.py index 0366aa3b8a..a0012e4a04 100644 --- a/authentication/middleware.py +++ b/authentication/middleware.py @@ -1,9 +1,10 @@ """Authentication middleware""" +from urllib.parse import quote + from django.shortcuts import redirect from social_core.exceptions import SocialAuthBaseException from social_django.middleware import SocialAuthExceptionMiddleware -from urllib.parse import quote class SocialAuthExceptionRedirectMiddleware(SocialAuthExceptionMiddleware): diff --git a/ecommerce/admin.py b/ecommerce/admin.py index 6e8dda6f29..9cc3790d89 100644 --- a/ecommerce/admin.py +++ b/ecommerce/admin.py @@ -221,7 +221,7 @@ class BaseOrderAdmin(fsm.FlowAdminMixin, TimestampedModelAdmin): readonly_fields = ["reference_number"] flow_state = OrderFlow.state - def get_transition_fields(self, request, obj, slug): # noqa: ARG002 + def get_transition_fields(self, request, obj, slug): # noqa: ARG002 return ["state"] def get_object_flow(self, request, obj): diff --git a/ecommerce/models.py b/ecommerce/models.py index 5d12ff2ebe..6fccff14dc 100644 --- a/ecommerce/models.py +++ b/ecommerce/models.py @@ -461,7 +461,7 @@ def _get_order_state(self): return self.order.state @state.on_success() - def _on_transition_success(self, descriptor, source, target, **kwargs): # noqa: ARG002 + def _on_transition_success(self, descriptor, source, target, **kwargs): # noqa: ARG002 self.order.save() @state.transition(source=State.ANY, target=OrderStatus.CANCELED) diff --git a/flexiblepricing/api_test.py b/flexiblepricing/api_test.py index c04a7b90d3..c5b823d92e 100644 --- a/flexiblepricing/api_test.py +++ b/flexiblepricing/api_test.py @@ -61,7 +61,10 @@ def test_parse_country_income_thresholds_no_header(tmp_path): """parse_country_income_thresholds should throw error if no header is found""" path = tmp_path / "test.csv" - with open(path, "w"), pytest.raises(CountryIncomeThresholdException) as exc: # create a file # noqa: SIM115, PTH123 + with ( + open(path, "w"), + pytest.raises(CountryIncomeThresholdException) as exc, + ): # create a file parse_country_income_thresholds(path) assert exc.value.args[0] == "Unable to find the header row"