From 3826ca207ae7c08b6d3628c404403e8538d9957c Mon Sep 17 00:00:00 2001 From: PCoder Date: Sun, 24 Dec 2017 12:48:03 +0100 Subject: [PATCH] Reformat code --- digitalglarus/views.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/digitalglarus/views.py b/digitalglarus/views.py index 017dd090..4efa21db 100644 --- a/digitalglarus/views.py +++ b/digitalglarus/views.py @@ -355,16 +355,21 @@ class MembershipPaymentView(LoginRequiredMixin, IsNotMemberMixin, FormView): membership_type = data.get('membership_type') # Get or create stripe customer - customer = StripeCustomer.get_or_create(email=self.request.user.email, - token=token) + customer = StripeCustomer.get_or_create( + email=self.request.user.email, token=token + ) if not customer: form.add_error("__all__", "Invalid credit card") - return self.render_to_response(self.get_context_data(form=form)) + return self.render_to_response( + self.get_context_data(form=form) + ) # Make stripe charge to a customer stripe_utils = StripeUtils() - charge_response = stripe_utils.make_charge(amount=membership_type.first_month_price, - customer=customer.stripe_id) + charge_response = stripe_utils.make_charge( + amount=membership_type.first_month_price, + customer=customer.stripe_id + ) charge = charge_response.get('response_object') # Check if the payment was approved