diff --git a/api/graphql/choice_fields.py b/api/graphql/choice_fields.py index 113470501..1bbd8d5ea 100644 --- a/api/graphql/choice_fields.py +++ b/api/graphql/choice_fields.py @@ -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): diff --git a/api/graphql/reservation_units/reservation_unit_mutations.py b/api/graphql/reservation_units/reservation_unit_mutations.py index 45f5f90b0..7c9e976e1 100644 --- a/api/graphql/reservation_units/reservation_unit_mutations.py +++ b/api/graphql/reservation_units/reservation_unit_mutations.py @@ -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 diff --git a/api/graphql/reservation_units/reservation_unit_serializers.py b/api/graphql/reservation_units/reservation_unit_serializers.py index bd146976f..52289a138 100644 --- a/api/graphql/reservation_units/reservation_unit_serializers.py +++ b/api/graphql/reservation_units/reservation_unit_serializers.py @@ -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)}." ), ) @@ -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)}." ), ) diff --git a/api/graphql/reservation_units/reservation_unit_types.py b/api/graphql/reservation_units/reservation_unit_types.py index 1fbade9df..8b97ec396 100644 --- a/api/graphql/reservation_units/reservation_unit_types.py +++ b/api/graphql/reservation_units/reservation_unit_types.py @@ -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: diff --git a/api/graphql/reservations/reservation_serializers/refund_serializers.py b/api/graphql/reservations/reservation_serializers/refund_serializers.py index d46122bdf..4d4736263 100644 --- a/api/graphql/reservations/reservation_serializers/refund_serializers.py +++ b/api/graphql/reservations/reservation_serializers/refund_serializers.py @@ -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, ) diff --git a/api/graphql/reservations/reservation_serializers/staff_reservation_modify_serializers.py b/api/graphql/reservations/reservation_serializers/staff_reservation_modify_serializers.py index 6702418b1..599ffa0b5 100644 --- a/api/graphql/reservations/reservation_serializers/staff_reservation_modify_serializers.py +++ b/api/graphql/reservations/reservation_serializers/staff_reservation_modify_serializers.py @@ -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 diff --git a/api/graphql/reservations/reservation_serializers/update_serializers.py b/api/graphql/reservations/reservation_serializers/update_serializers.py index 4d732c29c..0ea17ac39 100644 --- a/api/graphql/reservations/reservation_serializers/update_serializers.py +++ b/api/graphql/reservations/reservation_serializers/update_serializers.py @@ -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 diff --git a/api/ical_api.py b/api/ical_api.py index 365578b34..decc39492 100644 --- a/api/ical_api.py +++ b/api/ical_api.py @@ -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 diff --git a/merchants/verkkokauppa/order/requests.py b/merchants/verkkokauppa/order/requests.py index aaca21cc8..f4faddf8a 100644 --- a/merchants/verkkokauppa/order/requests.py +++ b/merchants/verkkokauppa/order/requests.py @@ -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") @@ -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") diff --git a/merchants/verkkokauppa/payment/requests.py b/merchants/verkkokauppa/payment/requests.py index 35bad783a..b715f81a4 100644 --- a/merchants/verkkokauppa/payment/requests.py +++ b/merchants/verkkokauppa/payment/requests.py @@ -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") @@ -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}")