{"action":"created","comment":{"url":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/comments/72257121","id":72257121,"diff_hunk":"@@ -33,37 +40,42 @@ def check_permissions(parent, user, is_publishing, is_sharing):\n         is_sharing = is_sharing and parent_perms.can_publish()\n \n \n-def share(page, is_sharing, is_publishing):\n-    if is_sharing or is_publishing:\n+def share(page, is_sharing, is_live):\n+    if is_sharing or is_live:\n         page.shared = True\n         page.has_unshared_changes = False\n     else:\n         page.has_unshared_changes = True\n     page.save()\n \n \n-# Sets the latest revision with a state depending on if the request is to\n-# publish, share, or save the page.\n-def configure_page_revision(page, is_sharing, is_publishing):\n+# `CFGOVPage.route()` will select the latest revision of the page where `live`\n+# is set to True and return that revision as a page object to serve the request\n+# so here we configure the latest revision to fall in line with that logic.\n+#\n+# This is also used as a signal callback when publishing in code or via\n+# management command like publish_scheduled_pages.\n+def configure_page_revision(page, is_sharing, is_live):\n     latest = page.get_latest_revision()\n     content_json = json.loads(latest.content_json)\n-    content_json['live'] = is_publishing\n-    content_json['shared'] = is_sharing or is_publishing\n-    content_json['has_unshared_changes'] = page.has_unshared_changes\n+    content_json['live'] = is_live\n+    content_json['shared'] = is_sharing or is_live\n+    content_json['has_unshared_changes'] = not is_sharing and not is_live\n     latest.content_json = json.dumps(content_json)\n     latest.save()\n-    if is_publishing:\n-        latest.publish()\n-        if settings.ENABLE_AKAMAI_CACHE_PURGE:\n-            from publish_eccu.publish import publish as akamai_cache_reset\n-\n-            url_paths = [page.url_path.replace('cfgov/', '')]\n-            if url_paths[0] == '/':\n-                is_home_page = True\n-            else:\n-                is_home_page = False\n \n-            akamai_cache_reset(url_paths, invalidate_root=is_home_page, user_email=latest.user.email)\n+\n+def flush_akamai(page, is_live):\n+    if is_live and settings.ENABLE_AKAMAI_CACHE_PURGE:\n+        from publish_eccu.publish import publish as akamai_cache_reset","path":"cfgov/v1/wagtail_hooks.py","position":75,"original_position":75,"commit_id":"dbbd4aa1a2bfd4aea413462610e4f276b296fba2","original_commit_id":"dbbd4aa1a2bfd4aea413462610e4f276b296fba2","user":{"login":"vccabral","id":515096,"avatar_url":"https://avatars.githubusercontent.com/u/515096?v=3","gravatar_id":"","url":"https://api.github.com/users/vccabral","html_url":"https://github.com/vccabral","followers_url":"https://api.github.com/users/vccabral/followers","following_url":"https://api.github.com/users/vccabral/following{/other_user}","gists_url":"https://api.github.com/users/vccabral/gists{/gist_id}","starred_url":"https://api.github.com/users/vccabral/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vccabral/subscriptions","organizations_url":"https://api.github.com/users/vccabral/orgs","repos_url":"https://api.github.com/users/vccabral/repos","events_url":"https://api.github.com/users/vccabral/events{/privacy}","received_events_url":"https://api.github.com/users/vccabral/received_events","type":"User","site_admin":false},"body":"import on top?","created_at":"2016-07-26T14:14:46Z","updated_at":"2016-07-26T14:14:46Z","html_url":"https://github.com/cfpb/cfgov-refresh/pull/2241#discussion_r72257121","pull_request_url":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/2241","_links":{"self":{"href":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/comments/72257121"},"html":{"href":"https://github.com/cfpb/cfgov-refresh/pull/2241#discussion_r72257121"},"pull_request":{"href":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/2241"}}},"pull_request":{"url":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/2241","id":78855559,"html_url":"https://github.com/cfpb/cfgov-refresh/pull/2241","diff_url":"https://github.com/cfpb/cfgov-refresh/pull/2241.diff","patch_url":"https://github.com/cfpb/cfgov-refresh/pull/2241.patch","issue_url":"https://api.github.com/repos/cfpb/cfgov-refresh/issues/2241","number":2241,"state":"open","locked":false,"title":"Flapjack to Master","user":{"login":"kurtw","id":1412978,"avatar_url":"https://avatars.githubusercontent.com/u/1412978?v=3","gravatar_id":"","url":"https://api.github.com/users/kurtw","html_url":"https://github.com/kurtw","followers_url":"https://api.github.com/users/kurtw/followers","following_url":"https://api.github.com/users/kurtw/following{/other_user}","gists_url":"https://api.github.com/users/kurtw/gists{/gist_id}","starred_url":"https://api.github.com/users/kurtw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kurtw/subscriptions","organizations_url":"https://api.github.com/users/kurtw/orgs","repos_url":"https://api.github.com/users/kurtw/repos","events_url":"https://api.github.com/users/kurtw/events{/privacy}","received_events_url":"https://api.github.com/users/kurtw/received_events","type":"User","site_admin":false},"body":"This merges the flapjack branch into master.  @anselmbradford @contolini are these commits good to go?","created_at":"2016-07-26T13:53:57Z","updated_at":"2016-07-26T14:14:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6e382ef674a39678a809a91974ebe1891e602e6d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/2241/commits","review_comments_url":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/2241/comments","review_comment_url":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cfpb/cfgov-refresh/issues/2241/comments","statuses_url":"https://api.github.com/repos/cfpb/cfgov-refresh/statuses/dbbd4aa1a2bfd4aea413462610e4f276b296fba2","head":{"label":"cfpb:flapjack","ref":"flapjack","sha":"dbbd4aa1a2bfd4aea413462610e4f276b296fba2","user":{"login":"cfpb","id":1071563,"avatar_url":"https://avatars.githubusercontent.com/u/1071563?v=3","gravatar_id":"","url":"https://api.github.com/users/cfpb","html_url":"https://github.com/cfpb","followers_url":"https://api.github.com/users/cfpb/followers","following_url":"https://api.github.com/users/cfpb/following{/other_user}","gists_url":"https://api.github.com/users/cfpb/gists{/gist_id}","starred_url":"https://api.github.com/users/cfpb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfpb/subscriptions","organizations_url":"https://api.github.com/users/cfpb/orgs","repos_url":"https://api.github.com/users/cfpb/repos","events_url":"https://api.github.com/users/cfpb/events{/privacy}","received_events_url":"https://api.github.com/users/cfpb/received_events","type":"Organization","site_admin":false},"repo":{"id":18852566,"name":"cfgov-refresh","full_name":"cfpb/cfgov-refresh","owner":{"login":"cfpb","id":1071563,"avatar_url":"https://avatars.githubusercontent.com/u/1071563?v=3","gravatar_id":"","url":"https://api.github.com/users/cfpb","html_url":"https://github.com/cfpb","followers_url":"https://api.github.com/users/cfpb/followers","following_url":"https://api.github.com/users/cfpb/following{/other_user}","gists_url":"https://api.github.com/users/cfpb/gists{/gist_id}","starred_url":"https://api.github.com/users/cfpb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfpb/subscriptions","organizations_url":"https://api.github.com/users/cfpb/orgs","repos_url":"https://api.github.com/users/cfpb/repos","events_url":"https://api.github.com/users/cfpb/events{/privacy}","received_events_url":"https://api.github.com/users/cfpb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cfpb/cfgov-refresh","description":"Django project that powers the redesigned consumerfinance.gov website.","fork":false,"url":"https://api.github.com/repos/cfpb/cfgov-refresh","forks_url":"https://api.github.com/repos/cfpb/cfgov-refresh/forks","keys_url":"https://api.github.com/repos/cfpb/cfgov-refresh/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cfpb/cfgov-refresh/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cfpb/cfgov-refresh/teams","hooks_url":"https://api.github.com/repos/cfpb/cfgov-refresh/hooks","issue_events_url":"https://api.github.com/repos/cfpb/cfgov-refresh/issues/events{/number}","events_url":"https://api.github.com/repos/cfpb/cfgov-refresh/events","assignees_url":"https://api.github.com/repos/cfpb/cfgov-refresh/assignees{/user}","branches_url":"https://api.github.com/repos/cfpb/cfgov-refresh/branches{/branch}","tags_url":"https://api.github.com/repos/cfpb/cfgov-refresh/tags","blobs_url":"https://api.github.com/repos/cfpb/cfgov-refresh/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cfpb/cfgov-refresh/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cfpb/cfgov-refresh/git/refs{/sha}","trees_url":"https://api.github.com/repos/cfpb/cfgov-refresh/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cfpb/cfgov-refresh/statuses/{sha}","languages_url":"https://api.github.com/repos/cfpb/cfgov-refresh/languages","stargazers_url":"https://api.github.com/repos/cfpb/cfgov-refresh/stargazers","contributors_url":"https://api.github.com/repos/cfpb/cfgov-refresh/contributors","subscribers_url":"https://api.github.com/repos/cfpb/cfgov-refresh/subscribers","subscription_url":"https://api.github.com/repos/cfpb/cfgov-refresh/subscription","commits_url":"https://api.github.com/repos/cfpb/cfgov-refresh/commits{/sha}","git_commits_url":"https://api.github.com/repos/cfpb/cfgov-refresh/git/commits{/sha}","comments_url":"https://api.github.com/repos/cfpb/cfgov-refresh/comments{/number}","issue_comment_url":"https://api.github.com/repos/cfpb/cfgov-refresh/issues/comments{/number}","contents_url":"https://api.github.com/repos/cfpb/cfgov-refresh/contents/{+path}","compare_url":"https://api.github.com/repos/cfpb/cfgov-refresh/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cfpb/cfgov-refresh/merges","archive_url":"https://api.github.com/repos/cfpb/cfgov-refresh/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cfpb/cfgov-refresh/downloads","issues_url":"https://api.github.com/repos/cfpb/cfgov-refresh/issues{/number}","pulls_url":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls{/number}","milestones_url":"https://api.github.com/repos/cfpb/cfgov-refresh/milestones{/number}","notifications_url":"https://api.github.com/repos/cfpb/cfgov-refresh/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cfpb/cfgov-refresh/labels{/name}","releases_url":"https://api.github.com/repos/cfpb/cfgov-refresh/releases{/id}","deployments_url":"https://api.github.com/repos/cfpb/cfgov-refresh/deployments","created_at":"2014-04-16T19:22:03Z","updated_at":"2016-07-16T14:24:11Z","pushed_at":"2016-07-26T13:53:57Z","git_url":"git://github.com/cfpb/cfgov-refresh.git","ssh_url":"git@github.com:cfpb/cfgov-refresh.git","clone_url":"https://github.com/cfpb/cfgov-refresh.git","svn_url":"https://github.com/cfpb/cfgov-refresh","homepage":"http://www.consumerfinance.gov/","size":126927,"stargazers_count":67,"watchers_count":67,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":34,"mirror_url":null,"open_issues_count":97,"forks":34,"open_issues":97,"watchers":67,"default_branch":"master"}},"base":{"label":"cfpb:master","ref":"master","sha":"57b2493f537ae38fe5277fb8ef15558960abed8f","user":{"login":"cfpb","id":1071563,"avatar_url":"https://avatars.githubusercontent.com/u/1071563?v=3","gravatar_id":"","url":"https://api.github.com/users/cfpb","html_url":"https://github.com/cfpb","followers_url":"https://api.github.com/users/cfpb/followers","following_url":"https://api.github.com/users/cfpb/following{/other_user}","gists_url":"https://api.github.com/users/cfpb/gists{/gist_id}","starred_url":"https://api.github.com/users/cfpb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfpb/subscriptions","organizations_url":"https://api.github.com/users/cfpb/orgs","repos_url":"https://api.github.com/users/cfpb/repos","events_url":"https://api.github.com/users/cfpb/events{/privacy}","received_events_url":"https://api.github.com/users/cfpb/received_events","type":"Organization","site_admin":false},"repo":{"id":18852566,"name":"cfgov-refresh","full_name":"cfpb/cfgov-refresh","owner":{"login":"cfpb","id":1071563,"avatar_url":"https://avatars.githubusercontent.com/u/1071563?v=3","gravatar_id":"","url":"https://api.github.com/users/cfpb","html_url":"https://github.com/cfpb","followers_url":"https://api.github.com/users/cfpb/followers","following_url":"https://api.github.com/users/cfpb/following{/other_user}","gists_url":"https://api.github.com/users/cfpb/gists{/gist_id}","starred_url":"https://api.github.com/users/cfpb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfpb/subscriptions","organizations_url":"https://api.github.com/users/cfpb/orgs","repos_url":"https://api.github.com/users/cfpb/repos","events_url":"https://api.github.com/users/cfpb/events{/privacy}","received_events_url":"https://api.github.com/users/cfpb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cfpb/cfgov-refresh","description":"Django project that powers the redesigned consumerfinance.gov website.","fork":false,"url":"https://api.github.com/repos/cfpb/cfgov-refresh","forks_url":"https://api.github.com/repos/cfpb/cfgov-refresh/forks","keys_url":"https://api.github.com/repos/cfpb/cfgov-refresh/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cfpb/cfgov-refresh/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cfpb/cfgov-refresh/teams","hooks_url":"https://api.github.com/repos/cfpb/cfgov-refresh/hooks","issue_events_url":"https://api.github.com/repos/cfpb/cfgov-refresh/issues/events{/number}","events_url":"https://api.github.com/repos/cfpb/cfgov-refresh/events","assignees_url":"https://api.github.com/repos/cfpb/cfgov-refresh/assignees{/user}","branches_url":"https://api.github.com/repos/cfpb/cfgov-refresh/branches{/branch}","tags_url":"https://api.github.com/repos/cfpb/cfgov-refresh/tags","blobs_url":"https://api.github.com/repos/cfpb/cfgov-refresh/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cfpb/cfgov-refresh/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cfpb/cfgov-refresh/git/refs{/sha}","trees_url":"https://api.github.com/repos/cfpb/cfgov-refresh/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cfpb/cfgov-refresh/statuses/{sha}","languages_url":"https://api.github.com/repos/cfpb/cfgov-refresh/languages","stargazers_url":"https://api.github.com/repos/cfpb/cfgov-refresh/stargazers","contributors_url":"https://api.github.com/repos/cfpb/cfgov-refresh/contributors","subscribers_url":"https://api.github.com/repos/cfpb/cfgov-refresh/subscribers","subscription_url":"https://api.github.com/repos/cfpb/cfgov-refresh/subscription","commits_url":"https://api.github.com/repos/cfpb/cfgov-refresh/commits{/sha}","git_commits_url":"https://api.github.com/repos/cfpb/cfgov-refresh/git/commits{/sha}","comments_url":"https://api.github.com/repos/cfpb/cfgov-refresh/comments{/number}","issue_comment_url":"https://api.github.com/repos/cfpb/cfgov-refresh/issues/comments{/number}","contents_url":"https://api.github.com/repos/cfpb/cfgov-refresh/contents/{+path}","compare_url":"https://api.github.com/repos/cfpb/cfgov-refresh/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cfpb/cfgov-refresh/merges","archive_url":"https://api.github.com/repos/cfpb/cfgov-refresh/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cfpb/cfgov-refresh/downloads","issues_url":"https://api.github.com/repos/cfpb/cfgov-refresh/issues{/number}","pulls_url":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls{/number}","milestones_url":"https://api.github.com/repos/cfpb/cfgov-refresh/milestones{/number}","notifications_url":"https://api.github.com/repos/cfpb/cfgov-refresh/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cfpb/cfgov-refresh/labels{/name}","releases_url":"https://api.github.com/repos/cfpb/cfgov-refresh/releases{/id}","deployments_url":"https://api.github.com/repos/cfpb/cfgov-refresh/deployments","created_at":"2014-04-16T19:22:03Z","updated_at":"2016-07-16T14:24:11Z","pushed_at":"2016-07-26T13:53:57Z","git_url":"git://github.com/cfpb/cfgov-refresh.git","ssh_url":"git@github.com:cfpb/cfgov-refresh.git","clone_url":"https://github.com/cfpb/cfgov-refresh.git","svn_url":"https://github.com/cfpb/cfgov-refresh","homepage":"http://www.consumerfinance.gov/","size":126927,"stargazers_count":67,"watchers_count":67,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":34,"mirror_url":null,"open_issues_count":97,"forks":34,"open_issues":97,"watchers":67,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/2241"},"html":{"href":"https://github.com/cfpb/cfgov-refresh/pull/2241"},"issue":{"href":"https://api.github.com/repos/cfpb/cfgov-refresh/issues/2241"},"comments":{"href":"https://api.github.com/repos/cfpb/cfgov-refresh/issues/2241/comments"},"review_comments":{"href":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/2241/comments"},"review_comment":{"href":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/2241/commits"},"statuses":{"href":"https://api.github.com/repos/cfpb/cfgov-refresh/statuses/dbbd4aa1a2bfd4aea413462610e4f276b296fba2"}}}}
{"actor":{"display_login":"vccabral"}}