Browse Source

Cancelling a plan clears out Subscription.plan_name

pull/211/head
Pēteris Caune 6 years ago
parent
commit
1a9f7e17f8
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
4 changed files with 5 additions and 8 deletions
  1. +1
    -0
      hc/payments/models.py
  2. +2
    -0
      hc/payments/tests/test_set_plan.py
  3. +1
    -7
      templates/accounts/billing.html
  4. +1
    -1
      templates/payments/pricing.html

+ 1
- 0
hc/payments/models.py View File

@ -167,6 +167,7 @@ class Subscription(models.Model):
self.subscription_id = ""
self.plan_id = ""
self.plan_name = ""
self.save()
def pm_is_card(self):


+ 2
- 0
hc/payments/tests/test_set_plan.py View File

@ -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()


+ 1
- 7
templates/accounts/billing.html View File

@ -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>


+ 1
- 1
templates/payments/pricing.html View File

@ -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…
Cancel
Save