Skip to content

Commit

Permalink
reverse changes made by an autoformatter
Browse files Browse the repository at this point in the history
  • Loading branch information
jefer94 committed Dec 19, 2023
1 parent 87810db commit 442d7ca
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 35 deletions.
55 changes: 21 additions & 34 deletions breathecode/payments/services/stripe.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,47 +99,37 @@ def _i18n_validations(self, callback: callable, attempts=0):

except stripe.error.CardError as e:
logger.error(str(e))
raise PaymentException(
translation(
self.language,
en='Card declined',
es='Tarjeta rechazada',
slug='card-error',
),
slug='card-error',
silent=True,
)
raise PaymentException(translation(self.language,
en='Card declined',
es='Tarjeta rechazada',
slug='card-error'),
slug='card-error',
silent=True)

except stripe.error.RateLimitError as e:
logger.error(str(e))
raise PaymentException(translation(
self.language,
en='Too many requests',
es='Demasiadas solicitudes',
slug='rate-limit-error',
),
raise PaymentException(translation(self.language,
en='Too many requests',
es='Demasiadas solicitudes',
slug='rate-limit-error'),
slug='rate-limit-error',
silent=True)

except stripe.error.InvalidRequestError as e:
logger.error(str(e))
raise PaymentException(translation(
self.language,
en='Invalid request',
es='Solicitud invalida',
slug='invalid-request',
),
raise PaymentException(translation(self.language,
en='Invalid request',
es='Solicitud invalida',
slug='invalid-request'),
slug='invalid-request',
silent=True)

except stripe.error.AuthenticationError as e:
logger.error(str(e))
raise PaymentException(translation(
self.language,
en='Authentication error',
es='Error de autenticación',
slug='authentication-error',
),
raise PaymentException(translation(self.language,
en='Authentication error',
es='Error de autenticación',
slug='authentication-error'),
slug='authentication-error',
silent=True)

Expand All @@ -154,8 +144,7 @@ def _i18n_validations(self, callback: callable, attempts=0):
self.language,
en='Payment service are down, try again later',
es='El servicio de pago está caído, inténtalo de nuevo más tarde',
slug='payment-service-are-down',
),
slug='payment-service-are-down'),
slug='payment-service-are-down',
silent=True)

Expand All @@ -165,8 +154,7 @@ def _i18n_validations(self, callback: callable, attempts=0):
self.language,
en='We have problems with the payment provider, try again later',
es='Tenemos problemas con el proveedor de pago, inténtalo de nuevo más tarde',
slug='stripe-error',
),
slug='stripe-error'),
slug='stripe-error',
silent=True)

Expand All @@ -178,8 +166,7 @@ def _i18n_validations(self, callback: callable, attempts=0):
self.language,
en='A unexpected error occur during the payment process, please contact support',
es='Ocurrió un error inesperado durante el proceso de pago, comuníquese con soporte',
slug='unexpected-exception',
),
slug='unexpected-exception'),
slug='unexpected-exception',
silent=True)

Expand Down
1 change: 0 additions & 1 deletion breathecode/payments/tests/urls/tests_pay.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,6 @@ def get_exp():
bc.check.calls(activity_tasks.add_activity.delay.call_args_list, [
call(1, 'bag_created', related_type='payments.Bag', related_id=1),
])
assert 0


@pytest.mark.parametrize(
Expand Down

0 comments on commit 442d7ca

Please sign in to comment.