From: Yasin Date: Tue, 17 Sep 2013 13:21:48 +0000 (+0200) Subject: BugFix: MyAccount: Edit name is now possible if there was no entry previously X-Git-Tag: myslice-0.2-3~10 X-Git-Url: http://git.onelab.eu/?p=myslice.git;a=commitdiff_plain;h=c608b4ff51e867022e93eae2a17e83a4f85e62ac BugFix: MyAccount: Edit name is now possible if there was no entry previously --- diff --git a/portal/accountview.py b/portal/accountview.py index a95a7a45..5f7a3960 100644 --- a/portal/accountview.py +++ b/portal/accountview.py @@ -105,9 +105,12 @@ def account_process(request): config['lastname'] = edited_last_name config['authority'] = config.get('authority','Unknown Authority') updated_config = json.dumps(config) - + user_params = {'config': updated_config} + else: # it's needed if the config is empty + user_config['config']= '{"firstname":"' + edited_first_name + '", "lastname":"'+ edited_last_name + '", "authority": "Unknown Authority"}' + user_params = {'config': user_config['config']} # updating config local:user in manifold - user_params = { 'config': updated_config} + #user_params = { 'config': updated_config} manifold_update_user(request,user_params) # this will be depricated, we will show the success msg in same page return HttpResponse('Sucess: First Name and Last Name Updated!')