From e386ccaa0abab6feca78b2bc4a1024b6e78b5adc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Thu, 4 Jul 2019 09:39:31 +0300 Subject: [PATCH] Don't mention whatsapp in the pricing page if it's not enabled in settings. --- hc/payments/views.py | 7 ++++++- templates/payments/pricing.html | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/hc/payments/views.py b/hc/payments/views.py index 98466bf6..aa239ef8 100644 --- a/hc/payments/views.py +++ b/hc/payments/views.py @@ -1,5 +1,6 @@ from io import BytesIO +from django.conf import settings from django.contrib import messages from django.contrib.auth.decorators import login_required from django.http import ( @@ -33,7 +34,11 @@ def pricing(request): # subscription object is not created just by viewing a page. sub = Subscription.objects.filter(user_id=request.user.id).first() - ctx = {"page": "pricing", "sub": sub} + ctx = { + "page": "pricing", + "sub": sub, + "enable_whatsapp": settings.TWILIO_USE_WHATSAPP, + } return render(request, "payments/pricing.html", ctx) diff --git a/templates/payments/pricing.html b/templates/payments/pricing.html index abe85115..aba47891 100644 --- a/templates/payments/pricing.html +++ b/templates/payments/pricing.html @@ -110,7 +110,7 @@
  • 10 Team Members
  • 1000 Log Entries per Check
  • API Access
  • -
  • 50 SMS & WhatsApp Alerts per Month
  • +
  • 50 SMS {% if enable_whatsapp %}& WhatsApp{% endif %} Alerts per Month
  • Email Support
  • {% if not request.user.is_authenticated %} @@ -139,7 +139,7 @@
  • Unlimited Team Members
  • 1000 Log Entries per Check
  • API Access
  • -
  • 500 SMS & WhatsApp Alerts per Month
  • +
  • 500 SMS {% if enable_whatsapp %}& WhatsApp{% endif %} Alerts per Month
  • Priority Email Support
  • {% if not request.user.is_authenticated %}