From c8519058c49a20924f74f3ed50e45018db3c78cb Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 23 Dec 2020 18:31:45 +0530 Subject: [PATCH] Fix new_user_hosting_key_id --- datacenterlight/views.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/datacenterlight/views.py b/datacenterlight/views.py index 17690c78..d0a9419c 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -1120,9 +1120,10 @@ def do_provisioning(request, user, stripe_api_cus_id, card_details_response, new_user = authenticate(username=custom_user.email, password=password) logger.debug("User %s is authenticated" % custom_user.email) - if 'new_user_hosting_key_id' in request: + new_user_hosting_key_id = request.get('new_user_hosting_key_id', None) + if new_user_hosting_key_id: user_hosting_key = UserHostingKey.objects.get( - id=request['new_user_hosting_key_id']) + id=new_user_hosting_key_id) user_hosting_key.user = new_user user_hosting_key.save() logger.debug("User %s key is saved" % custom_user.email)