{"action":"created","comment":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments/182779871","pull_request_review_id":113644999,"id":182779871,"diff_hunk":"@@ -182,8 +249,42 @@ def absolute_api_v2_url(self):\n     def get_absolute_url(self):\n         return self.absolute_api_v2_url\n \n+class WikiPageNodeManager(models.Manager):\n+\n+    def create_for_node(self, node, name, content, auth):\n+        existing_wiki_page = WikiPage.objects.get_for_node(node, name)\n+        if existing_wiki_page:\n+            raise NodeStateError('Wiki Page already exists.')\n+\n+        wiki_page = WikiPage.objects.create(\n+            node=node,\n+            page_name=name,\n+            user=auth.user\n+        )\n+        # Creates a WikiVersion object\n+        wiki_page.update(auth.user, content)\n+        return wiki_page\n+\n+    def get_for_node(self, node, name=None, id=None):\n+        if name:\n+            try:\n+                name = (name or '').strip()","path":"addons/wiki/models.py","position":147,"original_position":147,"commit_id":"fda879d82dfae94fb956af3ca389751f40ba2e40","original_commit_id":"fda879d82dfae94fb956af3ca389751f40ba2e40","user":{"login":"Johnetordoff","id":9688518,"avatar_url":"https://avatars3.githubusercontent.com/u/9688518?v=4","gravatar_id":"","url":"https://api.github.com/users/Johnetordoff","html_url":"https://github.com/Johnetordoff","followers_url":"https://api.github.com/users/Johnetordoff/followers","following_url":"https://api.github.com/users/Johnetordoff/following{/other_user}","gists_url":"https://api.github.com/users/Johnetordoff/gists{/gist_id}","starred_url":"https://api.github.com/users/Johnetordoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Johnetordoff/subscriptions","organizations_url":"https://api.github.com/users/Johnetordoff/orgs","repos_url":"https://api.github.com/users/Johnetordoff/repos","events_url":"https://api.github.com/users/Johnetordoff/events{/privacy}","received_events_url":"https://api.github.com/users/Johnetordoff/received_events","type":"User","site_admin":false},"body":"I'm not really sure of the use of .strip() here, I can see why you would want to do this for the UX, but why remove whitespace before querying django? ","created_at":"2018-04-19T15:05:24Z","updated_at":"2018-04-19T15:12:49Z","html_url":"https://github.com/CenterForOpenScience/osf.io/pull/8288#discussion_r182779871","pull_request_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/8288","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments/182779871"},"html":{"href":"https://github.com/CenterForOpenScience/osf.io/pull/8288#discussion_r182779871"},"pull_request":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/8288"}}},"pull_request":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/8288","id":181751844,"html_url":"https://github.com/CenterForOpenScience/osf.io/pull/8288","diff_url":"https://github.com/CenterForOpenScience/osf.io/pull/8288.diff","patch_url":"https://github.com/CenterForOpenScience/osf.io/pull/8288.patch","issue_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/8288","number":8288,"state":"open","locked":false,"title":"Feature/Wiki Cleanup Post Normalization [PLAT-746]","user":{"login":"pattisdr","id":9755598,"avatar_url":"https://avatars2.githubusercontent.com/u/9755598?v=4","gravatar_id":"","url":"https://api.github.com/users/pattisdr","html_url":"https://github.com/pattisdr","followers_url":"https://api.github.com/users/pattisdr/followers","following_url":"https://api.github.com/users/pattisdr/following{/other_user}","gists_url":"https://api.github.com/users/pattisdr/gists{/gist_id}","starred_url":"https://api.github.com/users/pattisdr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pattisdr/subscriptions","organizations_url":"https://api.github.com/users/pattisdr/orgs","repos_url":"https://api.github.com/users/pattisdr/repos","events_url":"https://api.github.com/users/pattisdr/events{/privacy}","received_events_url":"https://api.github.com/users/pattisdr/received_events","type":"User","site_admin":false},"body":"## Purpose\r\n\r\nThe Node model shouldn't know about the Wiki models so we are moving wiki-related functions off the node model. \r\n\r\n## Changes\r\n- Wiki page helper functions moved from the Node model to the WikiPage or WikiVersion model\r\n  - update_node_wiki\r\n  - remove_node_wiki\r\n  - rename_node_wiki\r\n  - get_wiki_page\r\n  - get_wiki_version\r\n  - get_wiki_pages_latest\r\n  - include_wiki_settings\r\n  - check_spam (wiki portion_\r\n- Remove the wiki_pages_current and wiki_pages_versions properties from the Node model. \r\n- Remove the obsolete NodeWikiPage model (it has been replaced by WikiPage and WikiVersion)\r\n\r\n## QA Notes\r\n\r\nI would do a full regression of wikis - the same tests that were run with https://openscience.atlassian.net/browse/PLAT-469.  A lot of wiki code was rearranged.\r\n\r\n## Documentation\r\n\r\n<!-- Does any internal or external documentation need to be updated?\r\n     - Developer documentation? If so, link developer.osf.io PR here. \r\n-->\r\n\r\n## Side Effects\r\n\r\n<!-- Any possible side effects? -->\r\n\r\n## Ticket\r\n\r\nhttps://openscience.atlassian.net/browse/PLAT-746\r\n","created_at":"2018-04-16T04:41:17Z","updated_at":"2018-04-19T15:12:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dfe48965f67c63dfb03d20830e9065d0dfcfc8b8","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/8288/commits","review_comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/8288/comments","review_comment_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/8288/comments","statuses_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/fda879d82dfae94fb956af3ca389751f40ba2e40","head":{"label":"pattisdr:feature/wiki_cleanup_post_normalization","ref":"feature/wiki_cleanup_post_normalization","sha":"fda879d82dfae94fb956af3ca389751f40ba2e40","user":{"login":"pattisdr","id":9755598,"avatar_url":"https://avatars2.githubusercontent.com/u/9755598?v=4","gravatar_id":"","url":"https://api.github.com/users/pattisdr","html_url":"https://github.com/pattisdr","followers_url":"https://api.github.com/users/pattisdr/followers","following_url":"https://api.github.com/users/pattisdr/following{/other_user}","gists_url":"https://api.github.com/users/pattisdr/gists{/gist_id}","starred_url":"https://api.github.com/users/pattisdr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pattisdr/subscriptions","organizations_url":"https://api.github.com/users/pattisdr/orgs","repos_url":"https://api.github.com/users/pattisdr/repos","events_url":"https://api.github.com/users/pattisdr/events{/privacy}","received_events_url":"https://api.github.com/users/pattisdr/received_events","type":"User","site_admin":false},"repo":{"id":35900874,"name":"osf.io","full_name":"pattisdr/osf.io","owner":{"login":"pattisdr","id":9755598,"avatar_url":"https://avatars2.githubusercontent.com/u/9755598?v=4","gravatar_id":"","url":"https://api.github.com/users/pattisdr","html_url":"https://github.com/pattisdr","followers_url":"https://api.github.com/users/pattisdr/followers","following_url":"https://api.github.com/users/pattisdr/following{/other_user}","gists_url":"https://api.github.com/users/pattisdr/gists{/gist_id}","starred_url":"https://api.github.com/users/pattisdr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pattisdr/subscriptions","organizations_url":"https://api.github.com/users/pattisdr/orgs","repos_url":"https://api.github.com/users/pattisdr/repos","events_url":"https://api.github.com/users/pattisdr/events{/privacy}","received_events_url":"https://api.github.com/users/pattisdr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pattisdr/osf.io","description":"Facilitating Open Science","fork":true,"url":"https://api.github.com/repos/pattisdr/osf.io","forks_url":"https://api.github.com/repos/pattisdr/osf.io/forks","keys_url":"https://api.github.com/repos/pattisdr/osf.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pattisdr/osf.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pattisdr/osf.io/teams","hooks_url":"https://api.github.com/repos/pattisdr/osf.io/hooks","issue_events_url":"https://api.github.com/repos/pattisdr/osf.io/issues/events{/number}","events_url":"https://api.github.com/repos/pattisdr/osf.io/events","assignees_url":"https://api.github.com/repos/pattisdr/osf.io/assignees{/user}","branches_url":"https://api.github.com/repos/pattisdr/osf.io/branches{/branch}","tags_url":"https://api.github.com/repos/pattisdr/osf.io/tags","blobs_url":"https://api.github.com/repos/pattisdr/osf.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pattisdr/osf.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pattisdr/osf.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/pattisdr/osf.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pattisdr/osf.io/statuses/{sha}","languages_url":"https://api.github.com/repos/pattisdr/osf.io/languages","stargazers_url":"https://api.github.com/repos/pattisdr/osf.io/stargazers","contributors_url":"https://api.github.com/repos/pattisdr/osf.io/contributors","subscribers_url":"https://api.github.com/repos/pattisdr/osf.io/subscribers","subscription_url":"https://api.github.com/repos/pattisdr/osf.io/subscription","commits_url":"https://api.github.com/repos/pattisdr/osf.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/pattisdr/osf.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/pattisdr/osf.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/pattisdr/osf.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/pattisdr/osf.io/contents/{+path}","compare_url":"https://api.github.com/repos/pattisdr/osf.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pattisdr/osf.io/merges","archive_url":"https://api.github.com/repos/pattisdr/osf.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pattisdr/osf.io/downloads","issues_url":"https://api.github.com/repos/pattisdr/osf.io/issues{/number}","pulls_url":"https://api.github.com/repos/pattisdr/osf.io/pulls{/number}","milestones_url":"https://api.github.com/repos/pattisdr/osf.io/milestones{/number}","notifications_url":"https://api.github.com/repos/pattisdr/osf.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pattisdr/osf.io/labels{/name}","releases_url":"https://api.github.com/repos/pattisdr/osf.io/releases{/id}","deployments_url":"https://api.github.com/repos/pattisdr/osf.io/deployments","created_at":"2015-05-19T18:33:09Z","updated_at":"2016-01-11T21:17:43Z","pushed_at":"2018-04-19T15:03:46Z","git_url":"git://github.com/pattisdr/osf.io.git","ssh_url":"git@github.com:pattisdr/osf.io.git","clone_url":"https://github.com/pattisdr/osf.io.git","svn_url":"https://github.com/pattisdr/osf.io","homepage":"http://osf.io","size":170703,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":1,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"CenterForOpenScience:release/next-platform","ref":"release/next-platform","sha":"5a1ccb771273a9cbf9671d8d95ee1c02c6dc363a","user":{"login":"CenterForOpenScience","id":3344584,"avatar_url":"https://avatars1.githubusercontent.com/u/3344584?v=4","gravatar_id":"","url":"https://api.github.com/users/CenterForOpenScience","html_url":"https://github.com/CenterForOpenScience","followers_url":"https://api.github.com/users/CenterForOpenScience/followers","following_url":"https://api.github.com/users/CenterForOpenScience/following{/other_user}","gists_url":"https://api.github.com/users/CenterForOpenScience/gists{/gist_id}","starred_url":"https://api.github.com/users/CenterForOpenScience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CenterForOpenScience/subscriptions","organizations_url":"https://api.github.com/users/CenterForOpenScience/orgs","repos_url":"https://api.github.com/users/CenterForOpenScience/repos","events_url":"https://api.github.com/users/CenterForOpenScience/events{/privacy}","received_events_url":"https://api.github.com/users/CenterForOpenScience/received_events","type":"Organization","site_admin":false},"repo":{"id":10199599,"name":"osf.io","full_name":"CenterForOpenScience/osf.io","owner":{"login":"CenterForOpenScience","id":3344584,"avatar_url":"https://avatars1.githubusercontent.com/u/3344584?v=4","gravatar_id":"","url":"https://api.github.com/users/CenterForOpenScience","html_url":"https://github.com/CenterForOpenScience","followers_url":"https://api.github.com/users/CenterForOpenScience/followers","following_url":"https://api.github.com/users/CenterForOpenScience/following{/other_user}","gists_url":"https://api.github.com/users/CenterForOpenScience/gists{/gist_id}","starred_url":"https://api.github.com/users/CenterForOpenScience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CenterForOpenScience/subscriptions","organizations_url":"https://api.github.com/users/CenterForOpenScience/orgs","repos_url":"https://api.github.com/users/CenterForOpenScience/repos","events_url":"https://api.github.com/users/CenterForOpenScience/events{/privacy}","received_events_url":"https://api.github.com/users/CenterForOpenScience/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CenterForOpenScience/osf.io","description":"Facilitating Open Science","fork":false,"url":"https://api.github.com/repos/CenterForOpenScience/osf.io","forks_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/forks","keys_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/teams","hooks_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/hooks","issue_events_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/events{/number}","events_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/events","assignees_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/assignees{/user}","branches_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/branches{/branch}","tags_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/tags","blobs_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/{sha}","languages_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/languages","stargazers_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/stargazers","contributors_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/contributors","subscribers_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/subscribers","subscription_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/subscription","commits_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/contents/{+path}","compare_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/merges","archive_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/downloads","issues_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues{/number}","pulls_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls{/number}","milestones_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/milestones{/number}","notifications_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/labels{/name}","releases_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/releases{/id}","deployments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/deployments","created_at":"2013-05-21T15:53:37Z","updated_at":"2018-04-18T18:37:48Z","pushed_at":"2018-04-19T15:03:54Z","git_url":"git://github.com/CenterForOpenScience/osf.io.git","ssh_url":"git@github.com:CenterForOpenScience/osf.io.git","clone_url":"https://github.com/CenterForOpenScience/osf.io.git","svn_url":"https://github.com/CenterForOpenScience/osf.io","homepage":"https://osf.io","size":169564,"stargazers_count":435,"watchers_count":435,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":244,"mirror_url":null,"archived":false,"open_issues_count":224,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":244,"open_issues":224,"watchers":435,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/8288"},"html":{"href":"https://github.com/CenterForOpenScience/osf.io/pull/8288"},"issue":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/8288"},"comments":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/8288/comments"},"review_comments":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/8288/comments"},"review_comment":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/8288/commits"},"statuses":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/fda879d82dfae94fb956af3ca389751f40ba2e40"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"Johnetordoff"}}