From 79eba3b70c80c10d1f1a22713565d50ebd02a8e0 Mon Sep 17 00:00:00 2001 From: PCoder Date: Mon, 1 Jul 2019 08:28:28 +0530 Subject: [PATCH] Remove add SSH key form in order confirmation related code --- datacenterlight/views.py | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/datacenterlight/views.py b/datacenterlight/views.py index 99ceae8f..28372a89 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -588,31 +588,6 @@ class OrderConfirmationView(DetailView, FormView): return render(request, self.template_name, context) def post(self, request, *args, **kwargs): - # 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() - user = request.session.get('user') stripe_api_cus_id = request.session.get('customer') stripe_utils = StripeUtils()