forked from GithubBackups/healthchecks
Cancelling a plan clears out Subscription.plan_name
This commit is contained in:
parent
a8c102f799
commit
1a9f7e17f8
@ -167,6 +167,7 @@ class Subscription(models.Model):
|
||||
|
||||
self.subscription_id = ""
|
||||
self.plan_id = ""
|
||||
self.plan_name = ""
|
||||
self.save()
|
||||
|
||||
def pm_is_card(self):
|
||||
|
@ -108,6 +108,7 @@ class SetPlanTestCase(BaseTestCase):
|
||||
self.sub = Subscription(user=self.alice)
|
||||
self.sub.subscription_id = "test-id"
|
||||
self.sub.plan_id = "P20"
|
||||
self.sub.plan_name = "Business ($20/mo)"
|
||||
self.sub.save()
|
||||
|
||||
self.profile.sms_limit = 1
|
||||
@ -121,6 +122,7 @@ class SetPlanTestCase(BaseTestCase):
|
||||
sub = Subscription.objects.get(user=self.alice)
|
||||
self.assertEqual(sub.subscription_id, "")
|
||||
self.assertEqual(sub.plan_id, "")
|
||||
self.assertEqual(sub.plan_name, "")
|
||||
|
||||
# User's profile should have standard limits
|
||||
self.profile.refresh_from_db()
|
||||
|
@ -42,13 +42,7 @@
|
||||
<table class="table">
|
||||
<tr>
|
||||
<td>Current Plan</td>
|
||||
<td>
|
||||
{% if sub is None or sub.plan_id == "" %}
|
||||
Free
|
||||
{% else %}
|
||||
{{ sub.plan_name }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{{ sub.plan_name|default:"Hobbyist" }}</td>
|
||||
</tr>
|
||||
{% if sub.plan_id %}
|
||||
<tr>
|
||||
|
@ -27,7 +27,7 @@
|
||||
plan. Thank you for supporting {% site_name %}!
|
||||
{% else %}
|
||||
Your account is currently on the
|
||||
<strong>Hobbyist</strong> plan.
|
||||
<strong>{{ sub.plan_name|default:"Hobbyist" }}</strong> plan.
|
||||
{% endif %}
|
||||
</p>
|
||||
<p>
|
||||
|
Loading…
x
Reference in New Issue
Block a user