{"action":"created","comment":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments/58766519","id":58766519,"diff_hunk":"@@ -91,6 +91,19 @@ def restore(self, recursive=True, parent=None):\n         TrashedFileNode.remove_one(self)\n         return restored\n \n+    def get_guid(self, create=False):\n+        \"\"\"Attempt to find a Guid that points to this object.\n+        One will be created if requested.\n+        :rtype: Guid\n+        \"\"\"\n+        try:\n+            # Note sometimes multiple GUIDs can exist for\n+            # a single object. Just go with the first one\n+            return Guid.find(Q('referent', 'eq', self))[0]","path":"website/files/models/base.py","position":12,"original_position":12,"commit_id":"0a8b601ea0552809f13d33e0cd3b7a2f5b4ce2ef","original_commit_id":"eaca28af2c4aa6d7561fe5c09e0cea0f745212ad","user":{"login":"TomBaxter","id":407143,"avatar_url":"https://avatars.githubusercontent.com/u/407143?v=3","gravatar_id":"","url":"https://api.github.com/users/TomBaxter","html_url":"https://github.com/TomBaxter","followers_url":"https://api.github.com/users/TomBaxter/followers","following_url":"https://api.github.com/users/TomBaxter/following{/other_user}","gists_url":"https://api.github.com/users/TomBaxter/gists{/gist_id}","starred_url":"https://api.github.com/users/TomBaxter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomBaxter/subscriptions","organizations_url":"https://api.github.com/users/TomBaxter/orgs","repos_url":"https://api.github.com/users/TomBaxter/repos","events_url":"https://api.github.com/users/TomBaxter/events{/privacy}","received_events_url":"https://api.github.com/users/TomBaxter/received_events","type":"User","site_admin":false},"body":"Having trouble with this.\r\nI switched...         return Guid.find(Q('referent', 'eq', self))[0]\r\nto...                     return Guid.find_one(Q('referent', 'eq', self))\r\nbut that returns \"None\"\r\nIn the examples I looked at the object of find_one were either \"cls\" or \"FileNode.resolve_class(self.provider, kind)\"\r\nDo I need to use the resolve_class method? If so it looks like I would need to introduce a numerical \"kind\" to the code.","created_at":"2016-04-06T19:26:45Z","updated_at":"2016-04-06T19:26:45Z","html_url":"https://github.com/CenterForOpenScience/osf.io/pull/5329#discussion_r58766519","pull_request_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/5329","_links":{"self":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments/58766519"},"html":{"href":"https://github.com/CenterForOpenScience/osf.io/pull/5329#discussion_r58766519"},"pull_request":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/5329"}}},"pull_request":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/5329","id":64638306,"html_url":"https://github.com/CenterForOpenScience/osf.io/pull/5329","diff_url":"https://github.com/CenterForOpenScience/osf.io/pull/5329.diff","patch_url":"https://github.com/CenterForOpenScience/osf.io/pull/5329.patch","issue_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/5329","number":5329,"state":"open","locked":false,"title":"[RFR][Feature] OSF-5883 MFR render fialures. Show a better error message.","user":{"login":"TomBaxter","id":407143,"avatar_url":"https://avatars.githubusercontent.com/u/407143?v=3","gravatar_id":"","url":"https://api.github.com/users/TomBaxter","html_url":"https://github.com/TomBaxter","followers_url":"https://api.github.com/users/TomBaxter/followers","following_url":"https://api.github.com/users/TomBaxter/following{/other_user}","gists_url":"https://api.github.com/users/TomBaxter/gists{/gist_id}","starred_url":"https://api.github.com/users/TomBaxter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomBaxter/subscriptions","organizations_url":"https://api.github.com/users/TomBaxter/orgs","repos_url":"https://api.github.com/users/TomBaxter/repos","events_url":"https://api.github.com/users/TomBaxter/events{/privacy}","received_events_url":"https://api.github.com/users/TomBaxter/received_events","type":"User","site_admin":false},"body":"   Currently, error handling is broken for website/addons/base/views.py  \"def addon_view_or_download_file\". All failures will fall back to our base Flask error messages.\r\n   I've fixed the most basic issue, which appears to be have been a change in formatting. Adding \"data=\" to the custom messages has fixed this. However those errors still result in a new page with only the error messages passed.\r\n   There is a facility(def addon_deleted_file) for passing error messages to website/templates/project/view_file.mako That produces a much nicer error. Where possible produce errors in this nicer facility.\r\n\r\n\r\nTODO:\r\nIn all likelihood, the error messages were broken by upstream changes. Make tests to catch upstream changes. \r\n\r\n","created_at":"2016-03-30T14:38:54Z","updated_at":"2016-04-06T19:26:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0217e9f93da61f7f98267db570fbb78cadebad5d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/5329/commits","review_comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/5329/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/5329/comments","statuses_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/0a8b601ea0552809f13d33e0cd3b7a2f5b4ce2ef","head":{"label":"TomBaxter:feature/osf-5883","ref":"feature/osf-5883","sha":"0a8b601ea0552809f13d33e0cd3b7a2f5b4ce2ef","user":{"login":"TomBaxter","id":407143,"avatar_url":"https://avatars.githubusercontent.com/u/407143?v=3","gravatar_id":"","url":"https://api.github.com/users/TomBaxter","html_url":"https://github.com/TomBaxter","followers_url":"https://api.github.com/users/TomBaxter/followers","following_url":"https://api.github.com/users/TomBaxter/following{/other_user}","gists_url":"https://api.github.com/users/TomBaxter/gists{/gist_id}","starred_url":"https://api.github.com/users/TomBaxter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomBaxter/subscriptions","organizations_url":"https://api.github.com/users/TomBaxter/orgs","repos_url":"https://api.github.com/users/TomBaxter/repos","events_url":"https://api.github.com/users/TomBaxter/events{/privacy}","received_events_url":"https://api.github.com/users/TomBaxter/received_events","type":"User","site_admin":false},"repo":{"id":49153405,"name":"osf.io","full_name":"TomBaxter/osf.io","owner":{"login":"TomBaxter","id":407143,"avatar_url":"https://avatars.githubusercontent.com/u/407143?v=3","gravatar_id":"","url":"https://api.github.com/users/TomBaxter","html_url":"https://github.com/TomBaxter","followers_url":"https://api.github.com/users/TomBaxter/followers","following_url":"https://api.github.com/users/TomBaxter/following{/other_user}","gists_url":"https://api.github.com/users/TomBaxter/gists{/gist_id}","starred_url":"https://api.github.com/users/TomBaxter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomBaxter/subscriptions","organizations_url":"https://api.github.com/users/TomBaxter/orgs","repos_url":"https://api.github.com/users/TomBaxter/repos","events_url":"https://api.github.com/users/TomBaxter/events{/privacy}","received_events_url":"https://api.github.com/users/TomBaxter/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TomBaxter/osf.io","description":"Facilitating Open Science","fork":true,"url":"https://api.github.com/repos/TomBaxter/osf.io","forks_url":"https://api.github.com/repos/TomBaxter/osf.io/forks","keys_url":"https://api.github.com/repos/TomBaxter/osf.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TomBaxter/osf.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TomBaxter/osf.io/teams","hooks_url":"https://api.github.com/repos/TomBaxter/osf.io/hooks","issue_events_url":"https://api.github.com/repos/TomBaxter/osf.io/issues/events{/number}","events_url":"https://api.github.com/repos/TomBaxter/osf.io/events","assignees_url":"https://api.github.com/repos/TomBaxter/osf.io/assignees{/user}","branches_url":"https://api.github.com/repos/TomBaxter/osf.io/branches{/branch}","tags_url":"https://api.github.com/repos/TomBaxter/osf.io/tags","blobs_url":"https://api.github.com/repos/TomBaxter/osf.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TomBaxter/osf.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TomBaxter/osf.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/TomBaxter/osf.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TomBaxter/osf.io/statuses/{sha}","languages_url":"https://api.github.com/repos/TomBaxter/osf.io/languages","stargazers_url":"https://api.github.com/repos/TomBaxter/osf.io/stargazers","contributors_url":"https://api.github.com/repos/TomBaxter/osf.io/contributors","subscribers_url":"https://api.github.com/repos/TomBaxter/osf.io/subscribers","subscription_url":"https://api.github.com/repos/TomBaxter/osf.io/subscription","commits_url":"https://api.github.com/repos/TomBaxter/osf.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/TomBaxter/osf.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/TomBaxter/osf.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/TomBaxter/osf.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/TomBaxter/osf.io/contents/{+path}","compare_url":"https://api.github.com/repos/TomBaxter/osf.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TomBaxter/osf.io/merges","archive_url":"https://api.github.com/repos/TomBaxter/osf.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TomBaxter/osf.io/downloads","issues_url":"https://api.github.com/repos/TomBaxter/osf.io/issues{/number}","pulls_url":"https://api.github.com/repos/TomBaxter/osf.io/pulls{/number}","milestones_url":"https://api.github.com/repos/TomBaxter/osf.io/milestones{/number}","notifications_url":"https://api.github.com/repos/TomBaxter/osf.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TomBaxter/osf.io/labels{/name}","releases_url":"https://api.github.com/repos/TomBaxter/osf.io/releases{/id}","deployments_url":"https://api.github.com/repos/TomBaxter/osf.io/deployments","created_at":"2016-01-06T18:24:54Z","updated_at":"2016-01-11T14:41:20Z","pushed_at":"2016-04-06T17:08:52Z","git_url":"git://github.com/TomBaxter/osf.io.git","ssh_url":"git@github.com:TomBaxter/osf.io.git","clone_url":"https://github.com/TomBaxter/osf.io.git","svn_url":"https://github.com/TomBaxter/osf.io","homepage":"http://osf.io","size":126897,"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":"develop"}},"base":{"label":"CenterForOpenScience:develop","ref":"develop","sha":"110ee0b6bb6f48e79257db020db6dc6ffd5eabbf","user":{"login":"CenterForOpenScience","id":3344584,"avatar_url":"https://avatars.githubusercontent.com/u/3344584?v=3","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://avatars.githubusercontent.com/u/3344584?v=3","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":"2016-04-03T18:21:10Z","pushed_at":"2016-04-06T19:21:58Z","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":"http://osf.io","size":271697,"stargazers_count":208,"watchers_count":208,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":161,"mirror_url":null,"open_issues_count":216,"forks":161,"open_issues":216,"watchers":208,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/5329"},"html":{"href":"https://github.com/CenterForOpenScience/osf.io/pull/5329"},"issue":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/5329"},"comments":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/5329/comments"},"review_comments":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/5329/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/5329/commits"},"statuses":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/0a8b601ea0552809f13d33e0cd3b7a2f5b4ce2ef"}}}}