X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=portal%2Faccountview.py;h=f7fa1b8d342d524d5b1a5d3779d1d498afe39c61;hb=e617801d26f11513b71b0fcd5a7385938d1915ef;hp=646ea2c58d26bcabb5a63779ea6fbd0c7bc748b4;hpb=e98799c63302e7b5e920f473c58f5f7bde953053;p=myslice.git diff --git a/portal/accountview.py b/portal/accountview.py index 646ea2c5..f7fa1b8d 100644 --- a/portal/accountview.py +++ b/portal/accountview.py @@ -171,7 +171,7 @@ def account_process(request): # updating maniolf local:account table account_config = json.loads(account_detail['config']) # preserving user_hrn - user_hrn = account_config['user_hrn'] + user_hrn = account_config.get('user_hrn','N/A') keypair = '{"user_public_key":'+ public_key + ', "user_private_key":'+ private_key + ', "user_hrn":"'+ user_hrn + '"}' updated_config = json.dumps(account_config) @@ -196,7 +196,7 @@ def account_process(request): if file_extension in allowed_extension and re.search(r'ssh-rsa',file_content): account_config = json.loads(account_detail['config']) # preserving user_hrn - user_hrn = account_config['user_hrn'] + user_hrn = account_config.get('user_hrn','N/A') file_content = '{"user_public_key":"'+ file_content + '", "user_hrn":"'+ user_hrn +'"}' #file_content = re.sub("\r", "", file_content) #file_content = re.sub("\n", "\\n",file_content)