Skip to content

Commit

Permalink
BUG: convert start and end of discount to tstamps
Browse files Browse the repository at this point in the history
  • Loading branch information
otistamp committed Mar 7, 2017
1 parent 2195800 commit 1800a9b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pinax/stripe/actions/subscriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,11 @@ def sync_subscription_from_stripe_data(customer, subscription):
stripe_id=subscription["id"],
defaults=defaults
)
sub = utils.update_with_defaults(sub, defaults, created)
if subscription.get("discount", None):
start = subscription["discount"]["start"]
end = subscription["discount"]["end"]
start = utils.convert_tstamp(subscription["discount"]["start"])
end = utils.convert_tstamp(subscription["discount"]["end"]) if subscription["discount"]["end"] else None
models.Discount.objects.get_or_create(subscription=sub, start=start, end=end)
sub = utils.update_with_defaults(sub, defaults, created)
return sub


Expand Down

0 comments on commit 1800a9b

Please sign in to comment.