aboutsummaryrefslogtreecommitdiffstats
path: root/pyblackbird_cc/payments/models.py
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-09-09 08:57:00 +0100
committerMatthew Lemon <y@yulqen.org>2024-09-09 08:57:00 +0100
commit31966b6cbef88006056db44448cdaf59ba40533e (patch)
tree4ef34346feb14d689e3bb0c3a1b6098d30936077 /pyblackbird_cc/payments/models.py
parent63461fb0b86a8f4a1422673626311d0979cd1077 (diff)
Test passing: signal sent on sign-up to create subscription
- user signs up - signal sent which creates Subscription based on SubscriptionPlan allowing 10 downloads initially. Plan lasts 365 days at present
Diffstat (limited to 'pyblackbird_cc/payments/models.py')
-rw-r--r--pyblackbird_cc/payments/models.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pyblackbird_cc/payments/models.py b/pyblackbird_cc/payments/models.py
index 2b66c14..cbf462c 100644
--- a/pyblackbird_cc/payments/models.py
+++ b/pyblackbird_cc/payments/models.py
@@ -48,11 +48,11 @@ class SubscriptionPlan(models.Model):
price = models.DecimalField(max_digits=6, decimal_places=2)
description = models.TextField()
allowed_downloads = models.PositiveIntegerField()
- stripe_plan_id = models.CharField(max_length=255)
class Subscription(models.Model):
user = models.OneToOneField(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
+ plan = models.ForeignKey(SubscriptionPlan, on_delete=models.CASCADE)
is_active = models.BooleanField(default=False)
start_date = models.DateTimeField(null=True, blank=True)
end_date = models.DateTimeField(null=True, blank=True)