{"action":"created","comment":{"url":"https://api.github.com/repos/DOAJ/doaj/pulls/comments/40076662","id":40076662,"diff_hunk":"@@ -152,12 +149,19 @@ def prep(self):\n     @property\n     def api_key(self):\n         if self.has_role('api'):\n-            return self.data.get('api_key', None)\n+            # Return the stored api key if it's there, generate one if not (there should be one present if the role is)","path":"portality/models/account.py","position":28,"original_position":28,"commit_id":"d84c6611633af480aa4b132d7c503cc173240a70","original_commit_id":"40eca6d0cd88625501e550348ffc40a2ebecf10a","user":{"login":"emanuil-tolev","id":1190172,"avatar_url":"https://avatars.githubusercontent.com/u/1190172?v=3","gravatar_id":"","url":"https://api.github.com/users/emanuil-tolev","html_url":"https://github.com/emanuil-tolev","followers_url":"https://api.github.com/users/emanuil-tolev/followers","following_url":"https://api.github.com/users/emanuil-tolev/following{/other_user}","gists_url":"https://api.github.com/users/emanuil-tolev/gists{/gist_id}","starred_url":"https://api.github.com/users/emanuil-tolev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emanuil-tolev/subscriptions","organizations_url":"https://api.github.com/users/emanuil-tolev/orgs","repos_url":"https://api.github.com/users/emanuil-tolev/repos","events_url":"https://api.github.com/users/emanuil-tolev/events{/privacy}","received_events_url":"https://api.github.com/users/emanuil-tolev/received_events","type":"User","site_admin":false},"body":"> as a side note, why can't I put a function call in the dict.get() method? when I tried to write self.data.get('api_key', self.generate_api_key()) it always ran the generate, whereas if the default arg was None it would return the key from the dict.\r\n\r\nHmm. Sorry, no idea beyond putting it in a temporary var.","created_at":"2015-09-22T11:47:01Z","updated_at":"2015-09-22T11:47:01Z","html_url":"https://github.com/DOAJ/doaj/pull/870#discussion_r40076662","pull_request_url":"https://api.github.com/repos/DOAJ/doaj/pulls/870","_links":{"self":{"href":"https://api.github.com/repos/DOAJ/doaj/pulls/comments/40076662"},"html":{"href":"https://github.com/DOAJ/doaj/pull/870#discussion_r40076662"},"pull_request":{"href":"https://api.github.com/repos/DOAJ/doaj/pulls/870"}}},"pull_request":{"url":"https://api.github.com/repos/DOAJ/doaj/pulls/870","id":45533270,"html_url":"https://github.com/DOAJ/doaj/pull/870","diff_url":"https://github.com/DOAJ/doaj/pull/870.diff","patch_url":"https://github.com/DOAJ/doaj/pull/870.patch","issue_url":"https://api.github.com/repos/DOAJ/doaj/issues/870","number":870,"state":"open","locked":false,"title":"Hotfix/2015 09 19 2000 new acc role bug","user":{"login":"Steven-Eardley","id":1446355,"avatar_url":"https://avatars.githubusercontent.com/u/1446355?v=3","gravatar_id":"","url":"https://api.github.com/users/Steven-Eardley","html_url":"https://github.com/Steven-Eardley","followers_url":"https://api.github.com/users/Steven-Eardley/followers","following_url":"https://api.github.com/users/Steven-Eardley/following{/other_user}","gists_url":"https://api.github.com/users/Steven-Eardley/gists{/gist_id}","starred_url":"https://api.github.com/users/Steven-Eardley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Steven-Eardley/subscriptions","organizations_url":"https://api.github.com/users/Steven-Eardley/orgs","repos_url":"https://api.github.com/users/Steven-Eardley/repos","events_url":"https://api.github.com/users/Steven-Eardley/events{/privacy}","received_events_url":"https://api.github.com/users/Steven-Eardley/received_events","type":"User","site_admin":false},"body":"**Hotfix**\r\n\r\nfor issue #849 ","created_at":"2015-09-21T10:30:09Z","updated_at":"2015-09-22T11:47:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9e01f31c83092d9c389d69ec81ec3eb3cb026876","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/DOAJ/doaj/pulls/870/commits","review_comments_url":"https://api.github.com/repos/DOAJ/doaj/pulls/870/comments","review_comment_url":"https://api.github.com/repos/DOAJ/doaj/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DOAJ/doaj/issues/870/comments","statuses_url":"https://api.github.com/repos/DOAJ/doaj/statuses/d84c6611633af480aa4b132d7c503cc173240a70","head":{"label":"DOAJ:hotfix/2015-09-19_2000_new_acc_role_bug","ref":"hotfix/2015-09-19_2000_new_acc_role_bug","sha":"d84c6611633af480aa4b132d7c503cc173240a70","user":{"login":"DOAJ","id":5971926,"avatar_url":"https://avatars.githubusercontent.com/u/5971926?v=3","gravatar_id":"","url":"https://api.github.com/users/DOAJ","html_url":"https://github.com/DOAJ","followers_url":"https://api.github.com/users/DOAJ/followers","following_url":"https://api.github.com/users/DOAJ/following{/other_user}","gists_url":"https://api.github.com/users/DOAJ/gists{/gist_id}","starred_url":"https://api.github.com/users/DOAJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DOAJ/subscriptions","organizations_url":"https://api.github.com/users/DOAJ/orgs","repos_url":"https://api.github.com/users/DOAJ/repos","events_url":"https://api.github.com/users/DOAJ/events{/privacy}","received_events_url":"https://api.github.com/users/DOAJ/received_events","type":"Organization","site_admin":false},"repo":{"id":14500626,"name":"doaj","full_name":"DOAJ/doaj","owner":{"login":"DOAJ","id":5971926,"avatar_url":"https://avatars.githubusercontent.com/u/5971926?v=3","gravatar_id":"","url":"https://api.github.com/users/DOAJ","html_url":"https://github.com/DOAJ","followers_url":"https://api.github.com/users/DOAJ/followers","following_url":"https://api.github.com/users/DOAJ/following{/other_user}","gists_url":"https://api.github.com/users/DOAJ/gists{/gist_id}","starred_url":"https://api.github.com/users/DOAJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DOAJ/subscriptions","organizations_url":"https://api.github.com/users/DOAJ/orgs","repos_url":"https://api.github.com/users/DOAJ/repos","events_url":"https://api.github.com/users/DOAJ/events{/privacy}","received_events_url":"https://api.github.com/users/DOAJ/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DOAJ/doaj","description":"The Directory of Open Access Journals - website and directory software","fork":false,"url":"https://api.github.com/repos/DOAJ/doaj","forks_url":"https://api.github.com/repos/DOAJ/doaj/forks","keys_url":"https://api.github.com/repos/DOAJ/doaj/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DOAJ/doaj/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DOAJ/doaj/teams","hooks_url":"https://api.github.com/repos/DOAJ/doaj/hooks","issue_events_url":"https://api.github.com/repos/DOAJ/doaj/issues/events{/number}","events_url":"https://api.github.com/repos/DOAJ/doaj/events","assignees_url":"https://api.github.com/repos/DOAJ/doaj/assignees{/user}","branches_url":"https://api.github.com/repos/DOAJ/doaj/branches{/branch}","tags_url":"https://api.github.com/repos/DOAJ/doaj/tags","blobs_url":"https://api.github.com/repos/DOAJ/doaj/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DOAJ/doaj/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DOAJ/doaj/git/refs{/sha}","trees_url":"https://api.github.com/repos/DOAJ/doaj/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DOAJ/doaj/statuses/{sha}","languages_url":"https://api.github.com/repos/DOAJ/doaj/languages","stargazers_url":"https://api.github.com/repos/DOAJ/doaj/stargazers","contributors_url":"https://api.github.com/repos/DOAJ/doaj/contributors","subscribers_url":"https://api.github.com/repos/DOAJ/doaj/subscribers","subscription_url":"https://api.github.com/repos/DOAJ/doaj/subscription","commits_url":"https://api.github.com/repos/DOAJ/doaj/commits{/sha}","git_commits_url":"https://api.github.com/repos/DOAJ/doaj/git/commits{/sha}","comments_url":"https://api.github.com/repos/DOAJ/doaj/comments{/number}","issue_comment_url":"https://api.github.com/repos/DOAJ/doaj/issues/comments{/number}","contents_url":"https://api.github.com/repos/DOAJ/doaj/contents/{+path}","compare_url":"https://api.github.com/repos/DOAJ/doaj/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DOAJ/doaj/merges","archive_url":"https://api.github.com/repos/DOAJ/doaj/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DOAJ/doaj/downloads","issues_url":"https://api.github.com/repos/DOAJ/doaj/issues{/number}","pulls_url":"https://api.github.com/repos/DOAJ/doaj/pulls{/number}","milestones_url":"https://api.github.com/repos/DOAJ/doaj/milestones{/number}","notifications_url":"https://api.github.com/repos/DOAJ/doaj/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DOAJ/doaj/labels{/name}","releases_url":"https://api.github.com/repos/DOAJ/doaj/releases{/id}","created_at":"2013-11-18T18:07:31Z","updated_at":"2015-06-03T03:16:30Z","pushed_at":"2015-09-22T10:57:38Z","git_url":"git://github.com/DOAJ/doaj.git","ssh_url":"git@github.com:DOAJ/doaj.git","clone_url":"https://github.com/DOAJ/doaj.git","svn_url":"https://github.com/DOAJ/doaj","homepage":null,"size":10412,"stargazers_count":5,"watchers_count":5,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":138,"forks":1,"open_issues":138,"watchers":5,"default_branch":"develop"}},"base":{"label":"DOAJ:develop","ref":"develop","sha":"eca005bddeab0428e549a4e9e1126de7840b7e04","user":{"login":"DOAJ","id":5971926,"avatar_url":"https://avatars.githubusercontent.com/u/5971926?v=3","gravatar_id":"","url":"https://api.github.com/users/DOAJ","html_url":"https://github.com/DOAJ","followers_url":"https://api.github.com/users/DOAJ/followers","following_url":"https://api.github.com/users/DOAJ/following{/other_user}","gists_url":"https://api.github.com/users/DOAJ/gists{/gist_id}","starred_url":"https://api.github.com/users/DOAJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DOAJ/subscriptions","organizations_url":"https://api.github.com/users/DOAJ/orgs","repos_url":"https://api.github.com/users/DOAJ/repos","events_url":"https://api.github.com/users/DOAJ/events{/privacy}","received_events_url":"https://api.github.com/users/DOAJ/received_events","type":"Organization","site_admin":false},"repo":{"id":14500626,"name":"doaj","full_name":"DOAJ/doaj","owner":{"login":"DOAJ","id":5971926,"avatar_url":"https://avatars.githubusercontent.com/u/5971926?v=3","gravatar_id":"","url":"https://api.github.com/users/DOAJ","html_url":"https://github.com/DOAJ","followers_url":"https://api.github.com/users/DOAJ/followers","following_url":"https://api.github.com/users/DOAJ/following{/other_user}","gists_url":"https://api.github.com/users/DOAJ/gists{/gist_id}","starred_url":"https://api.github.com/users/DOAJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DOAJ/subscriptions","organizations_url":"https://api.github.com/users/DOAJ/orgs","repos_url":"https://api.github.com/users/DOAJ/repos","events_url":"https://api.github.com/users/DOAJ/events{/privacy}","received_events_url":"https://api.github.com/users/DOAJ/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DOAJ/doaj","description":"The Directory of Open Access Journals - website and directory software","fork":false,"url":"https://api.github.com/repos/DOAJ/doaj","forks_url":"https://api.github.com/repos/DOAJ/doaj/forks","keys_url":"https://api.github.com/repos/DOAJ/doaj/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DOAJ/doaj/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DOAJ/doaj/teams","hooks_url":"https://api.github.com/repos/DOAJ/doaj/hooks","issue_events_url":"https://api.github.com/repos/DOAJ/doaj/issues/events{/number}","events_url":"https://api.github.com/repos/DOAJ/doaj/events","assignees_url":"https://api.github.com/repos/DOAJ/doaj/assignees{/user}","branches_url":"https://api.github.com/repos/DOAJ/doaj/branches{/branch}","tags_url":"https://api.github.com/repos/DOAJ/doaj/tags","blobs_url":"https://api.github.com/repos/DOAJ/doaj/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DOAJ/doaj/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DOAJ/doaj/git/refs{/sha}","trees_url":"https://api.github.com/repos/DOAJ/doaj/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DOAJ/doaj/statuses/{sha}","languages_url":"https://api.github.com/repos/DOAJ/doaj/languages","stargazers_url":"https://api.github.com/repos/DOAJ/doaj/stargazers","contributors_url":"https://api.github.com/repos/DOAJ/doaj/contributors","subscribers_url":"https://api.github.com/repos/DOAJ/doaj/subscribers","subscription_url":"https://api.github.com/repos/DOAJ/doaj/subscription","commits_url":"https://api.github.com/repos/DOAJ/doaj/commits{/sha}","git_commits_url":"https://api.github.com/repos/DOAJ/doaj/git/commits{/sha}","comments_url":"https://api.github.com/repos/DOAJ/doaj/comments{/number}","issue_comment_url":"https://api.github.com/repos/DOAJ/doaj/issues/comments{/number}","contents_url":"https://api.github.com/repos/DOAJ/doaj/contents/{+path}","compare_url":"https://api.github.com/repos/DOAJ/doaj/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DOAJ/doaj/merges","archive_url":"https://api.github.com/repos/DOAJ/doaj/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DOAJ/doaj/downloads","issues_url":"https://api.github.com/repos/DOAJ/doaj/issues{/number}","pulls_url":"https://api.github.com/repos/DOAJ/doaj/pulls{/number}","milestones_url":"https://api.github.com/repos/DOAJ/doaj/milestones{/number}","notifications_url":"https://api.github.com/repos/DOAJ/doaj/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DOAJ/doaj/labels{/name}","releases_url":"https://api.github.com/repos/DOAJ/doaj/releases{/id}","created_at":"2013-11-18T18:07:31Z","updated_at":"2015-06-03T03:16:30Z","pushed_at":"2015-09-22T10:57:38Z","git_url":"git://github.com/DOAJ/doaj.git","ssh_url":"git@github.com:DOAJ/doaj.git","clone_url":"https://github.com/DOAJ/doaj.git","svn_url":"https://github.com/DOAJ/doaj","homepage":null,"size":10412,"stargazers_count":5,"watchers_count":5,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":138,"forks":1,"open_issues":138,"watchers":5,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/DOAJ/doaj/pulls/870"},"html":{"href":"https://github.com/DOAJ/doaj/pull/870"},"issue":{"href":"https://api.github.com/repos/DOAJ/doaj/issues/870"},"comments":{"href":"https://api.github.com/repos/DOAJ/doaj/issues/870/comments"},"review_comments":{"href":"https://api.github.com/repos/DOAJ/doaj/pulls/870/comments"},"review_comment":{"href":"https://api.github.com/repos/DOAJ/doaj/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DOAJ/doaj/pulls/870/commits"},"statuses":{"href":"https://api.github.com/repos/DOAJ/doaj/statuses/d84c6611633af480aa4b132d7c503cc173240a70"}}}}