From f82c1968c916cad9bfecb6a0aea2b94d5c0d0c59 Mon Sep 17 00:00:00 2001 From: Michal Proszek Date: Wed, 6 Jun 2018 18:18:20 +0200 Subject: [PATCH] [BE] fix saving default_source --- CHANGELOG.txt | 4 ++++ aa_stripe/__init__.py | 2 +- aa_stripe/models.py | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 0df36bc..aaf25c2 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,9 @@ # Change Log All notable changes to this project will be documented in this file. +## [0.6.3] +### Fixed +- saving StripeCustomer.default_source + ## [0.6.2] ### Added - missing StripeCustomer.default_source field diff --git a/aa_stripe/__init__.py b/aa_stripe/__init__.py index 19d766c..3c1f03f 100644 --- a/aa_stripe/__init__.py +++ b/aa_stripe/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- __title__ = "Arabella Stripe" -__version__ = "0.6.2" +__version__ = "0.6.3" __author__ = "Jacek Ostanski" __license__ = "MIT" __copyright__ = "Copyright 2017 Arabella" diff --git a/aa_stripe/models.py b/aa_stripe/models.py index b7f4281..decf95e 100644 --- a/aa_stripe/models.py +++ b/aa_stripe/models.py @@ -93,8 +93,8 @@ def refresh_from_stripe(self): customer = self.retrieve_from_stripe() if customer: self.sources = customer.sources.data - self.default_source = customer.default_source - self.save(update_fields=["sources"]) + self.default_source = customer.default_source or "" + self.save() return customer def get_default_source_data(self):