BugFix: MyAccount: Edit name is now possible if there was no entry previously
authorYasin <mohammed-yasin.rahman@lip6.fr>
Tue, 17 Sep 2013 13:21:48 +0000 (15:21 +0200)
committerYasin <mohammed-yasin.rahman@lip6.fr>
Tue, 17 Sep 2013 13:21:48 +0000 (15:21 +0200)
portal/accountview.py

index a95a7a4..5f7a396 100644 (file)
@@ -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!')