Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 10, 2024
1 parent 4923ed5 commit 5044d6d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion authentication/middleware.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
2 changes: 1 addition & 1 deletion ecommerce/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion ecommerce/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion flexiblepricing/api_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 5044d6d

Please sign in to comment.