Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Properly save stripe_customer_id to the user profile

  • Loading branch information...
commit c4799dc6c2d8e276ab569585a1136efa80239fc5 1 parent 81e4012
Aaron C. de Bruyn darkpixel authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 shop_stripe/offsite_stripe.py
5 shop_stripe/offsite_stripe.py
View
@@ -81,8 +81,9 @@ def stripe_payment_view(self, request):
# If we're logged in, save the transaction token for use again later. Sweet.
if request.user.is_authenticated and request.user.get_profile().stripe_customer_id == None:
customer = stripe.Customer.create(card=card_token, description=description)
- request.user.get_profile().stripe_customer_id=customer.id
- request.user.save()
+ profile = request.user.get_profile()
+ profile.stripe_customer_id = customer.id
+ profile.save()
if hasattr(settings, 'SHOP_STRIPE_PUBLISHABLE_KEY'):
pub_key=settings.SHOP_STRIPE_PUBLISHABLE_KEY
Please sign in to comment.
Something went wrong with that request. Please try again.