From 75a778e65f031463b26f6bab0d08cf402879719d Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Thu, 31 Aug 2017 18:35:19 +0200 Subject: [PATCH] Added hosting_utils.py --- utils/hosting_utils.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 utils/hosting_utils.py diff --git a/utils/hosting_utils.py b/utils/hosting_utils.py new file mode 100644 index 00000000..d73fb6b0 --- /dev/null +++ b/utils/hosting_utils.py @@ -0,0 +1,11 @@ +from hosting.models import UserHostingKey + + +def get_all_public_keys(customer): + """ + Returns all the public keys of the user + :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)