Permalink
Browse files

Properly save stripe_customer_id to the user profile

  • Loading branch information...
1 parent 81e4012 commit c4799dc6c2d8e276ab569585a1136efa80239fc5 @darkpixel darkpixel committed May 5, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 shop_stripe/offsite_stripe.py
@@ -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

0 comments on commit c4799dc

Please sign in to comment.