From 175180e193640d4bf625db4fd76b268323f92e14 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 28 Oct 2017 20:45:00 +0200 Subject: [PATCH] Show DEFAULT text against the default card in the settings page --- hosting/models.py | 3 ++- hosting/templates/hosting/settings.html | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/hosting/models.py b/hosting/models.py index d6367301..ff116947 100644 --- a/hosting/models.py +++ b/hosting/models.py @@ -229,7 +229,8 @@ class UserCardDetail(AssignPermissionsMixin, models.Model): ) for card in user_card_details: cards_list.append({ - 'last4': card.last4, 'brand': card.brand, 'id': card.id + 'last4': card.last4, 'brand': card.brand, 'id': card.id, + 'preferred': card.preferred }) return cards_list diff --git a/hosting/templates/hosting/settings.html b/hosting/templates/hosting/settings.html index 5e0f7545..96e811cf 100644 --- a/hosting/templates/hosting/settings.html +++ b/hosting/templates/hosting/settings.html @@ -64,7 +64,11 @@
+ {% if card.preferred %} + {% trans "DEFAULT" %} + {% else %} {% trans "SELECT" %} + {% endif %}