From dc6fa5428e40572bcf2a879328d0cfd086f20f60 Mon Sep 17 00:00:00 2001 From: PCoder Date: Tue, 5 Sep 2017 03:29:12 +0530 Subject: [PATCH] Corrected filtering public ssh keys condition --- utils/hosting_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/hosting_utils.py b/utils/hosting_utils.py index d73fb6b0..7c1a83ad 100644 --- a/utils/hosting_utils.py +++ b/utils/hosting_utils.py @@ -7,5 +7,5 @@ def get_all_public_keys(customer): :param customer: The customer whose public keys are needed :return: A list of public keys """ - return UserHostingKey.objects.filter( - user__site__customuser=customer).values_list("public_key", flat=True) + return UserHostingKey.objects.filter(user_id=customer.id).values_list( + "public_key", flat=True)