From afb4279bea4c3b46d29bbc8dfdc63be7fc75f69a Mon Sep 17 00:00:00 2001 From: "Geek.Zone/Bot" Date: Tue, 23 Mar 2021 17:07:10 +0000 Subject: [PATCH] fixup: Format Python code with Black --- .../migrations/0009_auto_20210323_1611.py | 18 ++++++++++-------- memberships/payments.py | 4 +++- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/memberships/migrations/0009_auto_20210323_1611.py b/memberships/migrations/0009_auto_20210323_1611.py index e53b13aa..2d4d59dd 100644 --- a/memberships/migrations/0009_auto_20210323_1611.py +++ b/memberships/migrations/0009_auto_20210323_1611.py @@ -7,22 +7,24 @@ class Migration(migrations.Migration): dependencies = [ - ('memberships', '0008_member_renewal_date'), + ("memberships", "0008_member_renewal_date"), ] operations = [ migrations.RemoveField( - model_name='failedpayment', - name='stripe_customer_id', + model_name="failedpayment", + name="stripe_customer_id", ), migrations.AddField( - model_name='failedpayment', - name='member', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='memberships.member'), + model_name="failedpayment", + name="member", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, to="memberships.member" + ), ), migrations.AlterField( - model_name='member', - name='stripe_customer_id', + model_name="member", + name="stripe_customer_id", field=models.CharField(max_length=255, unique=True), ), ] diff --git a/memberships/payments.py b/memberships/payments.py index d3fb2cbb..b0e2baff 100644 --- a/memberships/payments.py +++ b/memberships/payments.py @@ -13,7 +13,9 @@ def handle_stripe_payment(event): return session_completed(event) if event["type"] == "invoice.payment_failed": FailedPayment.objects.create( - member=Member.objects.get(stripe_customer_id=event["data"]["object"]["customer"]), + member=Member.objects.get( + stripe_customer_id=event["data"]["object"]["customer"] + ), stripe_subscription_id=event["data"]["object"]["subscription"], stripe_event_type=event["type"], )