Skip to content

Commit

Permalink
fixup: Format Python code with Black
Browse files Browse the repository at this point in the history
  • Loading branch information
Geek.Zone/Bot authored and SamWinterhalder committed Mar 28, 2021
1 parent d1b720d commit afb4279
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
18 changes: 10 additions & 8 deletions memberships/migrations/0009_auto_20210323_1611.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
),
]
4 changes: 3 additions & 1 deletion memberships/payments.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
)
Expand Down

0 comments on commit afb4279

Please sign in to comment.