{"action":"created","comment":{"url":"https://api.github.com/repos/AppScale/appscale/pulls/comments/86430797","pull_request_review_id":7033969,"id":86430797,"diff_hunk":"@@ -647,3 +729,125 @@ def can_upload_apps(self):\n     except Exception as err:\n       logging.exception(err)\n       return False\n+\n+  def set_dash_layout_settings(self, values=None):\n+    \"\"\" Saves user settings\n+        for customizing the UI of the Dashboard.\n+\n+    Args:\n+      values: A JSON str that defines the layout of the dash page\n+        from /ajax/save/layout\n+    \"\"\"\n+    user = users.get_current_user()\n+    if not user:\n+      return\n+    email = user.email()\n+    try:\n+      user_info = self.get_by_id(UserInfo, email)\n+      if user_info:\n+        try:\n+          temp_dict = json.loads(values)\n+        except TypeError as err:\n+          #base admin template\n+          default_value = '''{\n+            \"nav\":[\"app_management\", \"appscale_management\",\n+            \"debugging_monitoring\"],\n+            \"panel\":[\"app_console\",\"upload_app\",\"cloud_stats\",\"database_stats\",\n+            \"memcache_stats\"]\n+            }'''\n+          temp_dict = json.loads(default_value)\n+        LOOKUP_DICT = self.build_dict(email=email)\n+        temp_dict['nav'] = [{key: LOOKUP_DICT.get(key)} for key in\n+                            temp_dict.get('nav') if\n+                            key in LOOKUP_DICT]\n+\n+        temp_dict['panel'] = [{key: LOOKUP_DICT.get(key)} for key in\n+                              temp_dict.get('panel') if\n+                              key in LOOKUP_DICT]\n+        user_info.dash_layout_settings = temp_dict\n+        user_info.put()\n+      return\n+    except Exception as err:\n+      logging.exception(err)","path":"AppDashboard/lib/app_dashboard_data.py","position":168,"original_position":168,"commit_id":"8bed3370721d71f0127a7efe46e77870a7181ed7","original_commit_id":"8bed3370721d71f0127a7efe46e77870a7181ed7","user":{"login":"cdonati","id":1923367,"avatar_url":"https://avatars.githubusercontent.com/u/1923367?v=3","gravatar_id":"","url":"https://api.github.com/users/cdonati","html_url":"https://github.com/cdonati","followers_url":"https://api.github.com/users/cdonati/followers","following_url":"https://api.github.com/users/cdonati/following{/other_user}","gists_url":"https://api.github.com/users/cdonati/gists{/gist_id}","starred_url":"https://api.github.com/users/cdonati/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdonati/subscriptions","organizations_url":"https://api.github.com/users/cdonati/orgs","repos_url":"https://api.github.com/users/cdonati/repos","events_url":"https://api.github.com/users/cdonati/events{/privacy}","received_events_url":"https://api.github.com/users/cdonati/received_events","type":"User","site_admin":false},"body":"This is too generic. The calling function will have no idea that something went wrong.","created_at":"2016-11-03T20:02:47Z","updated_at":"2016-11-03T20:02:47Z","html_url":"https://github.com/AppScale/appscale/pull/2199#discussion_r86430797","pull_request_url":"https://api.github.com/repos/AppScale/appscale/pulls/2199","_links":{"self":{"href":"https://api.github.com/repos/AppScale/appscale/pulls/comments/86430797"},"html":{"href":"https://github.com/AppScale/appscale/pull/2199#discussion_r86430797"},"pull_request":{"href":"https://api.github.com/repos/AppScale/appscale/pulls/2199"}}},"pull_request":{"url":"https://api.github.com/repos/AppScale/appscale/pulls/2199","id":89236788,"html_url":"https://github.com/AppScale/appscale/pull/2199","diff_url":"https://github.com/AppScale/appscale/pull/2199.diff","patch_url":"https://github.com/AppScale/appscale/pull/2199.patch","issue_url":"https://api.github.com/repos/AppScale/appscale/issues/2199","number":2199,"state":"open","locked":false,"title":"AppDashboard Redesign","user":{"login":"whoarethebritons","id":5721397,"avatar_url":"https://avatars.githubusercontent.com/u/5721397?v=3","gravatar_id":"","url":"https://api.github.com/users/whoarethebritons","html_url":"https://github.com/whoarethebritons","followers_url":"https://api.github.com/users/whoarethebritons/followers","following_url":"https://api.github.com/users/whoarethebritons/following{/other_user}","gists_url":"https://api.github.com/users/whoarethebritons/gists{/gist_id}","starred_url":"https://api.github.com/users/whoarethebritons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whoarethebritons/subscriptions","organizations_url":"https://api.github.com/users/whoarethebritons/orgs","repos_url":"https://api.github.com/users/whoarethebritons/repos","events_url":"https://api.github.com/users/whoarethebritons/events{/privacy}","received_events_url":"https://api.github.com/users/whoarethebritons/received_events","type":"User","site_admin":false},"body":"loading from JSON string to templates in dashboard\n","created_at":"2016-10-13T16:27:06Z","updated_at":"2016-11-03T21:03:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6efd2bb683a5982f4889275e279429eadd204dbb","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/AppScale/appscale/pulls/2199/commits","review_comments_url":"https://api.github.com/repos/AppScale/appscale/pulls/2199/comments","review_comment_url":"https://api.github.com/repos/AppScale/appscale/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AppScale/appscale/issues/2199/comments","statuses_url":"https://api.github.com/repos/AppScale/appscale/statuses/8bed3370721d71f0127a7efe46e77870a7181ed7","head":{"label":"whoarethebritons:appdashboard-updates","ref":"appdashboard-updates","sha":"8bed3370721d71f0127a7efe46e77870a7181ed7","user":{"login":"whoarethebritons","id":5721397,"avatar_url":"https://avatars.githubusercontent.com/u/5721397?v=3","gravatar_id":"","url":"https://api.github.com/users/whoarethebritons","html_url":"https://github.com/whoarethebritons","followers_url":"https://api.github.com/users/whoarethebritons/followers","following_url":"https://api.github.com/users/whoarethebritons/following{/other_user}","gists_url":"https://api.github.com/users/whoarethebritons/gists{/gist_id}","starred_url":"https://api.github.com/users/whoarethebritons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whoarethebritons/subscriptions","organizations_url":"https://api.github.com/users/whoarethebritons/orgs","repos_url":"https://api.github.com/users/whoarethebritons/repos","events_url":"https://api.github.com/users/whoarethebritons/events{/privacy}","received_events_url":"https://api.github.com/users/whoarethebritons/received_events","type":"User","site_admin":false},"repo":{"id":70172985,"name":"appscale","full_name":"whoarethebritons/appscale","owner":{"login":"whoarethebritons","id":5721397,"avatar_url":"https://avatars.githubusercontent.com/u/5721397?v=3","gravatar_id":"","url":"https://api.github.com/users/whoarethebritons","html_url":"https://github.com/whoarethebritons","followers_url":"https://api.github.com/users/whoarethebritons/followers","following_url":"https://api.github.com/users/whoarethebritons/following{/other_user}","gists_url":"https://api.github.com/users/whoarethebritons/gists{/gist_id}","starred_url":"https://api.github.com/users/whoarethebritons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whoarethebritons/subscriptions","organizations_url":"https://api.github.com/users/whoarethebritons/orgs","repos_url":"https://api.github.com/users/whoarethebritons/repos","events_url":"https://api.github.com/users/whoarethebritons/events{/privacy}","received_events_url":"https://api.github.com/users/whoarethebritons/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/whoarethebritons/appscale","description":"The Open Source Implementation of Google App Engine -- Take your apps everywhere.","fork":true,"url":"https://api.github.com/repos/whoarethebritons/appscale","forks_url":"https://api.github.com/repos/whoarethebritons/appscale/forks","keys_url":"https://api.github.com/repos/whoarethebritons/appscale/keys{/key_id}","collaborators_url":"https://api.github.com/repos/whoarethebritons/appscale/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/whoarethebritons/appscale/teams","hooks_url":"https://api.github.com/repos/whoarethebritons/appscale/hooks","issue_events_url":"https://api.github.com/repos/whoarethebritons/appscale/issues/events{/number}","events_url":"https://api.github.com/repos/whoarethebritons/appscale/events","assignees_url":"https://api.github.com/repos/whoarethebritons/appscale/assignees{/user}","branches_url":"https://api.github.com/repos/whoarethebritons/appscale/branches{/branch}","tags_url":"https://api.github.com/repos/whoarethebritons/appscale/tags","blobs_url":"https://api.github.com/repos/whoarethebritons/appscale/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/whoarethebritons/appscale/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/whoarethebritons/appscale/git/refs{/sha}","trees_url":"https://api.github.com/repos/whoarethebritons/appscale/git/trees{/sha}","statuses_url":"https://api.github.com/repos/whoarethebritons/appscale/statuses/{sha}","languages_url":"https://api.github.com/repos/whoarethebritons/appscale/languages","stargazers_url":"https://api.github.com/repos/whoarethebritons/appscale/stargazers","contributors_url":"https://api.github.com/repos/whoarethebritons/appscale/contributors","subscribers_url":"https://api.github.com/repos/whoarethebritons/appscale/subscribers","subscription_url":"https://api.github.com/repos/whoarethebritons/appscale/subscription","commits_url":"https://api.github.com/repos/whoarethebritons/appscale/commits{/sha}","git_commits_url":"https://api.github.com/repos/whoarethebritons/appscale/git/commits{/sha}","comments_url":"https://api.github.com/repos/whoarethebritons/appscale/comments{/number}","issue_comment_url":"https://api.github.com/repos/whoarethebritons/appscale/issues/comments{/number}","contents_url":"https://api.github.com/repos/whoarethebritons/appscale/contents/{+path}","compare_url":"https://api.github.com/repos/whoarethebritons/appscale/compare/{base}...{head}","merges_url":"https://api.github.com/repos/whoarethebritons/appscale/merges","archive_url":"https://api.github.com/repos/whoarethebritons/appscale/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/whoarethebritons/appscale/downloads","issues_url":"https://api.github.com/repos/whoarethebritons/appscale/issues{/number}","pulls_url":"https://api.github.com/repos/whoarethebritons/appscale/pulls{/number}","milestones_url":"https://api.github.com/repos/whoarethebritons/appscale/milestones{/number}","notifications_url":"https://api.github.com/repos/whoarethebritons/appscale/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/whoarethebritons/appscale/labels{/name}","releases_url":"https://api.github.com/repos/whoarethebritons/appscale/releases{/id}","deployments_url":"https://api.github.com/repos/whoarethebritons/appscale/deployments","created_at":"2016-10-06T16:40:20Z","updated_at":"2016-10-06T16:41:09Z","pushed_at":"2016-11-03T00:32:06Z","git_url":"git://github.com/whoarethebritons/appscale.git","ssh_url":"git@github.com:whoarethebritons/appscale.git","clone_url":"https://github.com/whoarethebritons/appscale.git","svn_url":"https://github.com/whoarethebritons/appscale","homepage":"https://www.appscale.com","size":124890,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"AppScale:master","ref":"master","sha":"53e89f167a67cada11299e58b0c64cff8727ec0e","user":{"login":"AppScale","id":1486044,"avatar_url":"https://avatars.githubusercontent.com/u/1486044?v=3","gravatar_id":"","url":"https://api.github.com/users/AppScale","html_url":"https://github.com/AppScale","followers_url":"https://api.github.com/users/AppScale/followers","following_url":"https://api.github.com/users/AppScale/following{/other_user}","gists_url":"https://api.github.com/users/AppScale/gists{/gist_id}","starred_url":"https://api.github.com/users/AppScale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AppScale/subscriptions","organizations_url":"https://api.github.com/users/AppScale/orgs","repos_url":"https://api.github.com/users/AppScale/repos","events_url":"https://api.github.com/users/AppScale/events{/privacy}","received_events_url":"https://api.github.com/users/AppScale/received_events","type":"Organization","site_admin":false},"repo":{"id":3803067,"name":"appscale","full_name":"AppScale/appscale","owner":{"login":"AppScale","id":1486044,"avatar_url":"https://avatars.githubusercontent.com/u/1486044?v=3","gravatar_id":"","url":"https://api.github.com/users/AppScale","html_url":"https://github.com/AppScale","followers_url":"https://api.github.com/users/AppScale/followers","following_url":"https://api.github.com/users/AppScale/following{/other_user}","gists_url":"https://api.github.com/users/AppScale/gists{/gist_id}","starred_url":"https://api.github.com/users/AppScale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AppScale/subscriptions","organizations_url":"https://api.github.com/users/AppScale/orgs","repos_url":"https://api.github.com/users/AppScale/repos","events_url":"https://api.github.com/users/AppScale/events{/privacy}","received_events_url":"https://api.github.com/users/AppScale/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AppScale/appscale","description":"The Open Source Implementation of Google App Engine -- Take your apps everywhere.","fork":false,"url":"https://api.github.com/repos/AppScale/appscale","forks_url":"https://api.github.com/repos/AppScale/appscale/forks","keys_url":"https://api.github.com/repos/AppScale/appscale/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AppScale/appscale/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AppScale/appscale/teams","hooks_url":"https://api.github.com/repos/AppScale/appscale/hooks","issue_events_url":"https://api.github.com/repos/AppScale/appscale/issues/events{/number}","events_url":"https://api.github.com/repos/AppScale/appscale/events","assignees_url":"https://api.github.com/repos/AppScale/appscale/assignees{/user}","branches_url":"https://api.github.com/repos/AppScale/appscale/branches{/branch}","tags_url":"https://api.github.com/repos/AppScale/appscale/tags","blobs_url":"https://api.github.com/repos/AppScale/appscale/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AppScale/appscale/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AppScale/appscale/git/refs{/sha}","trees_url":"https://api.github.com/repos/AppScale/appscale/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AppScale/appscale/statuses/{sha}","languages_url":"https://api.github.com/repos/AppScale/appscale/languages","stargazers_url":"https://api.github.com/repos/AppScale/appscale/stargazers","contributors_url":"https://api.github.com/repos/AppScale/appscale/contributors","subscribers_url":"https://api.github.com/repos/AppScale/appscale/subscribers","subscription_url":"https://api.github.com/repos/AppScale/appscale/subscription","commits_url":"https://api.github.com/repos/AppScale/appscale/commits{/sha}","git_commits_url":"https://api.github.com/repos/AppScale/appscale/git/commits{/sha}","comments_url":"https://api.github.com/repos/AppScale/appscale/comments{/number}","issue_comment_url":"https://api.github.com/repos/AppScale/appscale/issues/comments{/number}","contents_url":"https://api.github.com/repos/AppScale/appscale/contents/{+path}","compare_url":"https://api.github.com/repos/AppScale/appscale/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AppScale/appscale/merges","archive_url":"https://api.github.com/repos/AppScale/appscale/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AppScale/appscale/downloads","issues_url":"https://api.github.com/repos/AppScale/appscale/issues{/number}","pulls_url":"https://api.github.com/repos/AppScale/appscale/pulls{/number}","milestones_url":"https://api.github.com/repos/AppScale/appscale/milestones{/number}","notifications_url":"https://api.github.com/repos/AppScale/appscale/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AppScale/appscale/labels{/name}","releases_url":"https://api.github.com/repos/AppScale/appscale/releases{/id}","deployments_url":"https://api.github.com/repos/AppScale/appscale/deployments","created_at":"2012-03-22T22:35:50Z","updated_at":"2016-11-02T21:01:32Z","pushed_at":"2016-11-03T00:32:09Z","git_url":"git://github.com/AppScale/appscale.git","ssh_url":"git@github.com:AppScale/appscale.git","clone_url":"https://github.com/AppScale/appscale.git","svn_url":"https://github.com/AppScale/appscale","homepage":"https://www.appscale.com","size":128136,"stargazers_count":2211,"watchers_count":2211,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":260,"mirror_url":null,"open_issues_count":17,"forks":260,"open_issues":17,"watchers":2211,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AppScale/appscale/pulls/2199"},"html":{"href":"https://github.com/AppScale/appscale/pull/2199"},"issue":{"href":"https://api.github.com/repos/AppScale/appscale/issues/2199"},"comments":{"href":"https://api.github.com/repos/AppScale/appscale/issues/2199/comments"},"review_comments":{"href":"https://api.github.com/repos/AppScale/appscale/pulls/2199/comments"},"review_comment":{"href":"https://api.github.com/repos/AppScale/appscale/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AppScale/appscale/pulls/2199/commits"},"statuses":{"href":"https://api.github.com/repos/AppScale/appscale/statuses/8bed3370721d71f0127a7efe46e77870a7181ed7"}}}}
{"actor":{"display_login":"cdonati"}}