From c8c5bb763a9dd46adcfb79548cc41c4d1fad301e Mon Sep 17 00:00:00 2001 From: PCoder Date: Mon, 1 Jul 2019 20:36:13 +0530 Subject: [PATCH] Remove Add SSH key form in "Order Confirm" page related code (not needed) --- hosting/views.py | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/hosting/views.py b/hosting/views.py index 9f7ce8cc..201d58e7 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -941,31 +941,6 @@ class OrdersHostingDetailView(LoginRequiredMixin, DetailView, FormView): @method_decorator(decorators) def post(self, request): - # Check ssh public key and then proceed - form = self.get_form() - required = True - - # SSH key validation is required only if the user doesn't have an - # existing key and user has input some value in the add ssh key fields - if (len(get_all_public_keys(self.request.user)) > 0 and - (len(form.data.get('public_key')) == 0 and - len(form.data.get('name')) == 0)): - required = False - form.fields['name'].required = required - form.fields['public_key'].required = required - if not form.is_valid(): - response = { - 'status': False, - 'msg_title': str(_('SSH key related error occurred')), - 'msg_body': "
".join([str(v) for k,v in form.errors.items()]), - } - return JsonResponse(response) - - if required: - # We have a valid SSH key from the user, save it in opennebula and - # db and proceed further - form.save() - template = request.session.get('template') specs = request.session.get('specs') stripe_utils = StripeUtils()