From 2a8f02a19795265877b93b0986daa2c3f0b78e25 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 28 Oct 2017 22:32:35 +0200 Subject: [PATCH] Order by preferred and id fields for cards in settings page --- hosting/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosting/models.py b/hosting/models.py index 7da50294..9486eae7 100644 --- a/hosting/models.py +++ b/hosting/models.py @@ -226,7 +226,7 @@ class UserCardDetail(AssignPermissionsMixin, models.Model): return cards_list user_card_details = UserCardDetail.objects.filter( stripe_customer_id=stripe_customer.id - ) + ).order_by('-preferred', 'id') for card in user_card_details: cards_list.append({ 'last4': card.last4, 'brand': card.brand, 'id': card.id,