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] authored and matti-lamppu committed Aug 31, 2023
1 parent 9a83264 commit b83ecbf
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion api/graphql/choice_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

@deconstructible
class ChoiceValidator:
message = _('Choice "%(choice)s" is not allowed. ' "Allowed choices are: %(allowed_choices)s.")
message = _('Choice "%(choice)s" is not allowed. Allowed choices are: %(allowed_choices)s.')
code = "invalid_choice"

def __init__(self, allowed_choices):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def remove_personal_data_and_logs_on_archive(cls, input: Dict):

logger.info(
f"Reservation unit {reservation_unit_pk} archived. Content information "
+ f"removed and {deleted_log_entries} audit log entries deleted."
f"removed and {deleted_log_entries} audit log entries deleted."
)

@classmethod
Expand Down
4 changes: 2 additions & 2 deletions api/graphql/reservation_units/reservation_unit_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class ReservationUnitPricingCreateSerializer(PrimaryKeySerializer):
required=False,
choices=PriceUnit.choices,
help_text=(
"Unit of the price. " f"Possible values are {', '.join(value[0].upper() for value in PriceUnit.choices)}."
f"Unit of the price. Possible values are {', '.join(value[0].upper() for value in PriceUnit.choices)}."
),
)

Expand All @@ -126,7 +126,7 @@ class ReservationUnitPricingCreateSerializer(PrimaryKeySerializer):
required=True,
choices=PricingStatus.choices,
help_text=(
"Pricing status. " f"Possible values are {', '.join(value[0].upper() for value in PricingStatus.choices)}."
f"Pricing status. Possible values are {', '.join(value[0].upper() for value in PricingStatus.choices)}."
),
)

Expand Down
2 changes: 1 addition & 1 deletion api/graphql/reservation_units/reservation_unit_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def resolve_category(self, info):
class ReservationUnitPaymentTypeType(AuthNode, PrimaryKeyObjectType):
code = graphene.Field(
graphene.String,
description=("Available values: " f"{', '.join(value for value in get_payment_type_codes())}"),
description=f"Available values: {', '.join(value for value in get_payment_type_codes())}",
)

class Meta:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def validate(self, data):
if self.instance.state not in [STATE_CHOICES.CANCELLED, STATE_CHOICES.DENIED] and self.instance.end >= now:
raise ValidationErrorWithCode(
f"Only reservations in the past or in state {STATE_CHOICES.CANCELLED.upper()} "
+ f"or {STATE_CHOICES.DENIED.upper()} can be refunded.",
f"or {STATE_CHOICES.DENIED.upper()} can be refunded.",
ValidationErrorCodes.REFUND_NOT_ALLOWED,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def __init__(self, *args, **kwargs):
self.fields["state"].required = False
self.fields["state"].help_text = (
"String value for ReservationType's ReservationState enum. "
+ f"Possible values are {', '.join(value[0].upper() for value in ReservationState.STATE_CHOICES)}."
f"Possible values are {', '.join(value[0].upper() for value in ReservationState.STATE_CHOICES)}."
)
self.fields["priority"].required = False
self.fields["buffer_time_before"].required = False
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self, *args, **kwargs):
self.fields["state"].required = False
self.fields["state"].help_text = (
"String value for ReservationType's ReservationState enum. "
+ f"Possible values are {', '.join(value[0].upper() for value in STATE_CHOICES.STATE_CHOICES)}."
f"Possible values are {', '.join(value[0].upper() for value in STATE_CHOICES.STATE_CHOICES)}."
)
self.fields["reservee_first_name"].required = False
self.fields["reservee_last_name"].required = False
Expand Down
2 changes: 1 addition & 1 deletion api/ical_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def application_event_calendar(application_event: ApplicationEvent) -> Calendar:
elif contact_person:
applicant_name = f"{contact_person.first_name} {contact_person.last_name}"

cal["x-wr-calname"] = f"{applicant_name}, " f"{application_event.name}"
cal["x-wr-calname"] = f"{applicant_name}, {application_event.name}"
return cal


Expand Down
4 changes: 2 additions & 2 deletions merchants/verkkokauppa/order/requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def create_order(params: CreateOrderParams, post=_post) -> Order:
if response.status_code >= 500:
capture_message(
f"Call to Order Experience API failed with status {response.status_code}. "
+ f"Response body: {response.text}",
f"Response body: {response.text}",
level="error",
)
raise CreateOrderError("Order creation failed: problem with upstream service")
Expand Down Expand Up @@ -106,7 +106,7 @@ def cancel_order(order_id: UUID, user_uuid: UUID, post=_post) -> Optional[Order]
if response.status_code >= 500:
capture_message(
f"Call to Order Experience API cancel endpoint failed with status {response.status_code}. "
+ f"Response body: {response.text}",
f"Response body: {response.text}",
level="error",
)
raise CancelOrderError("Order cancellation failed: problem with upstream service")
Expand Down
6 changes: 3 additions & 3 deletions merchants/verkkokauppa/payment/requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def refund_order(order_id: UUID, post=_post) -> Optional[Refund]:
if response.status_code > 200:
capture_message(
f"Call to Payment Experience API refund endpoint failed with status {response.status_code}. "
+ f"Response body: {response.text}",
f"Response body: {response.text}",
level="error",
)
raise RefundPaymentError("Payment refund failed: problem with upstream service")
Expand All @@ -129,8 +129,8 @@ def refund_order(order_id: UUID, post=_post) -> Optional[Refund]:
else:
capture_message(
"Call to Payment Experience API refund endpoint failed. "
+ f"Response contains {refund_count} refunds instead of one. "
+ f"Response body: {response.text}",
f"Response contains {refund_count} refunds instead of one. "
f"Response body: {response.text}",
level="error",
)
raise RefundPaymentError(f"Refund response refund count expected to be 1 but was {refund_count}")
Expand Down

0 comments on commit b83ecbf

Please sign in to comment.