GitHub PullRequestReviewCommentEvent at 2014-11-18 09:59:06
Repository: invenio
Actor: jalavik
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/inveniosoftware/invenio/pulls/comments/20495493","id":20495493,"diff_hunk":"@@ -36,6 +38,20 @@\n                            CFG_BIBEDIT_ADD_TICKET_RT_QUEUES\n \n \n+def get_uid_based_on_pref(prefname, prefvalue):\n+    \"\"\"get the user's UID based where his/her preference prefname has value prefvalue in preferences\"\"\"\n+    prefs = run_sql(\"SELECT id, settings FROM user WHERE settings is not NULL\")\n+    the_uid = None\n+    for pref in prefs:\n+        try:\n+            settings = deserialize_via_marshal(pref[1])\n+            if (prefname in settings) and (settings[prefname] == prefvalue):\n+                the_uid = pref[0]\n+        except:\n+            pass","path":"invenio/legacy/bibcatalog/system_rt.py","position":27,"original_position":27,"commit_id":"66174f570c6016b03b0dec76b9bb690b80cd0767","original_commit_id":"16cf3a1da9be4c8783ca66c31f44017e4f9d4193","user":{"login":"jalavik","id":633680,"avatar_url":"https://avatars.githubusercontent.com/u/633680?v=3","gravatar_id":"","url":"https://api.github.com/users/jalavik","html_url":"https://github.com/jalavik","followers_url":"https://api.github.com/users/jalavik/followers","following_url":"https://api.github.com/users/jalavik/following{/other_user}","gists_url":"https://api.github.com/users/jalavik/gists{/gist_id}","starred_url":"https://api.github.com/users/jalavik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jalavik/subscriptions","organizations_url":"https://api.github.com/users/jalavik/orgs","repos_url":"https://api.github.com/users/jalavik/repos","events_url":"https://api.github.com/users/jalavik/events{/privacy}","received_events_url":"https://api.github.com/users/jalavik/received_events","type":"User","site_admin":false},"body":"Ah indeed! I was too distracted by the `except: pass` to see that. It needs to look in the settings blob though to get the right value, with future JSON query it should be better, but how to solve it today? \r\n\r\nAs part of #2340 we could factor it out to store it in the model linked with user table?","created_at":"2014-11-18T09:59:06Z","updated_at":"2014-11-18T09:59:06Z","html_url":"https://github.com/inveniosoftware/invenio/pull/2529#discussion_r20495493","pull_request_url":"https://api.github.com/repos/inveniosoftware/invenio/pulls/2529","_links":{"self":{"href":"https://api.github.com/repos/inveniosoftware/invenio/pulls/comments/20495493"},"html":{"href":"https://github.com/inveniosoftware/invenio/pull/2529#discussion_r20495493"},"pull_request":{"href":"https://api.github.com/repos/inveniosoftware/invenio/pulls/2529"}}},"pull_request":{"url":"https://api.github.com/repos/inveniosoftware/invenio/pulls/2529","id":24523993,"html_url":"https://github.com/inveniosoftware/invenio/pull/2529","diff_url":"https://github.com/inveniosoftware/invenio/pull/2529.diff","patch_url":"https://github.com/inveniosoftware/invenio/pull/2529.patch","issue_url":"https://api.github.com/repos/inveniosoftware/invenio/issues/2529","number":2529,"state":"open","locked":false,"title":"access: new has_(super)_admin_role methods","user":{"login":"jirikuncar","id":189798,"avatar_url":"https://avatars.githubusercontent.com/u/189798?v=3","gravatar_id":"","url":"https://api.github.com/users/jirikuncar","html_url":"https://github.com/jirikuncar","followers_url":"https://api.github.com/users/jirikuncar/followers","following_url":"https://api.github.com/users/jirikuncar/following{/other_user}","gists_url":"https://api.github.com/users/jirikuncar/gists{/gist_id}","starred_url":"https://api.github.com/users/jirikuncar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jirikuncar/subscriptions","organizations_url":"https://api.github.com/users/jirikuncar/orgs","repos_url":"https://api.github.com/users/jirikuncar/repos","events_url":"https://api.github.com/users/jirikuncar/events{/privacy}","received_events_url":"https://api.github.com/users/jirikuncar/received_events","type":"User","site_admin":false},"body":"* PEP8/257 improvements.\r\n* Adds simple Flask-Admin interface for access models.\r\n* Cleans legacy `webuser` usage.","created_at":"2014-11-17T09:47:15Z","updated_at":"2014-11-18T09:59:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1d18eb944fd76767c6a42c49c11bc2d9b16a2bb2","assignee":{"login":"jirikuncar","id":189798,"avatar_url":"https://avatars.githubusercontent.com/u/189798?v=3","gravatar_id":"","url":"https://api.github.com/users/jirikuncar","html_url":"https://github.com/jirikuncar","followers_url":"https://api.github.com/users/jirikuncar/followers","following_url":"https://api.github.com/users/jirikuncar/following{/other_user}","gists_url":"https://api.github.com/users/jirikuncar/gists{/gist_id}","starred_url":"https://api.github.com/users/jirikuncar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jirikuncar/subscriptions","organizations_url":"https://api.github.com/users/jirikuncar/orgs","repos_url":"https://api.github.com/users/jirikuncar/repos","events_url":"https://api.github.com/users/jirikuncar/events{/privacy}","received_events_url":"https://api.github.com/users/jirikuncar/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/inveniosoftware/invenio/milestones/6","labels_url":"https://api.github.com/repos/inveniosoftware/invenio/milestones/6/labels","id":696686,"number":6,"title":"v2.x","description":"","creator":{"login":"jirikuncar","id":189798,"avatar_url":"https://avatars.githubusercontent.com/u/189798?v=3","gravatar_id":"","url":"https://api.github.com/users/jirikuncar","html_url":"https://github.com/jirikuncar","followers_url":"https://api.github.com/users/jirikuncar/followers","following_url":"https://api.github.com/users/jirikuncar/following{/other_user}","gists_url":"https://api.github.com/users/jirikuncar/gists{/gist_id}","starred_url":"https://api.github.com/users/jirikuncar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jirikuncar/subscriptions","organizations_url":"https://api.github.com/users/jirikuncar/orgs","repos_url":"https://api.github.com/users/jirikuncar/repos","events_url":"https://api.github.com/users/jirikuncar/events{/privacy}","received_events_url":"https://api.github.com/users/jirikuncar/received_events","type":"User","site_admin":false},"open_issues":113,"closed_issues":56,"state":"open","created_at":"2014-06-20T11:43:39Z","updated_at":"2014-11-18T09:38:03Z","due_on":"2020-01-01T08:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/inveniosoftware/invenio/pulls/2529/commits","review_comments_url":"https://api.github.com/repos/inveniosoftware/invenio/pulls/2529/comments","review_comment_url":"https://api.github.com/repos/inveniosoftware/invenio/pulls/comments/{number}","comments_url":"https://api.github.com/repos/inveniosoftware/invenio/issues/2529/comments","statuses_url":"https://api.github.com/repos/inveniosoftware/invenio/statuses/66174f570c6016b03b0dec76b9bb690b80cd0767","head":{"label":"jirikuncar:2509-is-admin","ref":"2509-is-admin","sha":"66174f570c6016b03b0dec76b9bb690b80cd0767","user":{"login":"jirikuncar","id":189798,"avatar_url":"https://avatars.githubusercontent.com/u/189798?v=3","gravatar_id":"","url":"https://api.github.com/users/jirikuncar","html_url":"https://github.com/jirikuncar","followers_url":"https://api.github.com/users/jirikuncar/followers","following_url":"https://api.github.com/users/jirikuncar/following{/other_user}","gists_url":"https://api.github.com/users/jirikuncar/gists{/gist_id}","starred_url":"https://api.github.com/users/jirikuncar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jirikuncar/subscriptions","organizations_url":"https://api.github.com/users/jirikuncar/orgs","repos_url":"https://api.github.com/users/jirikuncar/repos","events_url":"https://api.github.com/users/jirikuncar/events{/privacy}","received_events_url":"https://api.github.com/users/jirikuncar/received_events","type":"User","site_admin":false},"repo":{"id":16106422,"name":"invenio","full_name":"jirikuncar/invenio","owner":{"login":"jirikuncar","id":189798,"avatar_url":"https://avatars.githubusercontent.com/u/189798?v=3","gravatar_id":"","url":"https://api.github.com/users/jirikuncar","html_url":"https://github.com/jirikuncar","followers_url":"https://api.github.com/users/jirikuncar/followers","following_url":"https://api.github.com/users/jirikuncar/following{/other_user}","gists_url":"https://api.github.com/users/jirikuncar/gists{/gist_id}","starred_url":"https://api.github.com/users/jirikuncar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jirikuncar/subscriptions","organizations_url":"https://api.github.com/users/jirikuncar/orgs","repos_url":"https://api.github.com/users/jirikuncar/repos","events_url":"https://api.github.com/users/jirikuncar/events{/privacy}","received_events_url":"https://api.github.com/users/jirikuncar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jirikuncar/invenio","description":"For contribution please check: https://github.com/jirikuncar/invenio/wiki/Contributor-checklist","fork":true,"url":"https://api.github.com/repos/jirikuncar/invenio","forks_url":"https://api.github.com/repos/jirikuncar/invenio/forks","keys_url":"https://api.github.com/repos/jirikuncar/invenio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jirikuncar/invenio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jirikuncar/invenio/teams","hooks_url":"https://api.github.com/repos/jirikuncar/invenio/hooks","issue_events_url":"https://api.github.com/repos/jirikuncar/invenio/issues/events{/number}","events_url":"https://api.github.com/repos/jirikuncar/invenio/events","assignees_url":"https://api.github.com/repos/jirikuncar/invenio/assignees{/user}","branches_url":"https://api.github.com/repos/jirikuncar/invenio/branches{/branch}","tags_url":"https://api.github.com/repos/jirikuncar/invenio/tags","blobs_url":"https://api.github.com/repos/jirikuncar/invenio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jirikuncar/invenio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jirikuncar/invenio/git/refs{/sha}","trees_url":"https://api.github.com/repos/jirikuncar/invenio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jirikuncar/invenio/statuses/{sha}","languages_url":"https://api.github.com/repos/jirikuncar/invenio/languages","stargazers_url":"https://api.github.com/repos/jirikuncar/invenio/stargazers","contributors_url":"https://api.github.com/repos/jirikuncar/invenio/contributors","subscribers_url":"https://api.github.com/repos/jirikuncar/invenio/subscribers","subscription_url":"https://api.github.com/repos/jirikuncar/invenio/subscription","commits_url":"https://api.github.com/repos/jirikuncar/invenio/commits{/sha}","git_commits_url":"https://api.github.com/repos/jirikuncar/invenio/git/commits{/sha}","comments_url":"https://api.github.com/repos/jirikuncar/invenio/comments{/number}","issue_comment_url":"https://api.github.com/repos/jirikuncar/invenio/issues/comments/{number}","contents_url":"https://api.github.com/repos/jirikuncar/invenio/contents/{+path}","compare_url":"https://api.github.com/repos/jirikuncar/invenio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jirikuncar/invenio/merges","archive_url":"https://api.github.com/repos/jirikuncar/invenio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jirikuncar/invenio/downloads","issues_url":"https://api.github.com/repos/jirikuncar/invenio/issues{/number}","pulls_url":"https://api.github.com/repos/jirikuncar/invenio/pulls{/number}","milestones_url":"https://api.github.com/repos/jirikuncar/invenio/milestones{/number}","notifications_url":"https://api.github.com/repos/jirikuncar/invenio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jirikuncar/invenio/labels{/name}","releases_url":"https://api.github.com/repos/jirikuncar/invenio/releases{/id}","created_at":"2014-01-21T15:23:07Z","updated_at":"2014-08-27T11:52:25Z","pushed_at":"2014-11-18T08:40:45Z","git_url":"git://github.com/jirikuncar/invenio.git","ssh_url":"git@github.com:jirikuncar/invenio.git","clone_url":"https://github.com/jirikuncar/invenio.git","svn_url":"https://github.com/jirikuncar/invenio","homepage":"http://invenio-software.org/","size":86670,"stargazers_count":5,"watchers_count":5,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":6,"forks":6,"open_issues":6,"watchers":5,"default_branch":"pu"}},"base":{"label":"inveniosoftware:pu","ref":"pu","sha":"7a15a70ad6c8a88fd55f8903269f3d9dbac7df59","user":{"login":"inveniosoftware","id":1157480,"avatar_url":"https://avatars.githubusercontent.com/u/1157480?v=3","gravatar_id":"","url":"https://api.github.com/users/inveniosoftware","html_url":"https://github.com/inveniosoftware","followers_url":"https://api.github.com/users/inveniosoftware/followers","following_url":"https://api.github.com/users/inveniosoftware/following{/other_user}","gists_url":"https://api.github.com/users/inveniosoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/inveniosoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inveniosoftware/subscriptions","organizations_url":"https://api.github.com/users/inveniosoftware/orgs","repos_url":"https://api.github.com/users/inveniosoftware/repos","events_url":"https://api.github.com/users/inveniosoftware/events{/privacy}","received_events_url":"https://api.github.com/users/inveniosoftware/received_events","type":"Organization","site_admin":false},"repo":{"id":2665618,"name":"invenio","full_name":"inveniosoftware/invenio","owner":{"login":"inveniosoftware","id":1157480,"avatar_url":"https://avatars.githubusercontent.com/u/1157480?v=3","gravatar_id":"","url":"https://api.github.com/users/inveniosoftware","html_url":"https://github.com/inveniosoftware","followers_url":"https://api.github.com/users/inveniosoftware/followers","following_url":"https://api.github.com/users/inveniosoftware/following{/other_user}","gists_url":"https://api.github.com/users/inveniosoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/inveniosoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inveniosoftware/subscriptions","organizations_url":"https://api.github.com/users/inveniosoftware/orgs","repos_url":"https://api.github.com/users/inveniosoftware/repos","events_url":"https://api.github.com/users/inveniosoftware/events{/privacy}","received_events_url":"https://api.github.com/users/inveniosoftware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/inveniosoftware/invenio","description":"Invenio digital library software","fork":false,"url":"https://api.github.com/repos/inveniosoftware/invenio","forks_url":"https://api.github.com/repos/inveniosoftware/invenio/forks","keys_url":"https://api.github.com/repos/inveniosoftware/invenio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/inveniosoftware/invenio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/inveniosoftware/invenio/teams","hooks_url":"https://api.github.com/repos/inveniosoftware/invenio/hooks","issue_events_url":"https://api.github.com/repos/inveniosoftware/invenio/issues/events{/number}","events_url":"https://api.github.com/repos/inveniosoftware/invenio/events","assignees_url":"https://api.github.com/repos/inveniosoftware/invenio/assignees{/user}","branches_url":"https://api.github.com/repos/inveniosoftware/invenio/branches{/branch}","tags_url":"https://api.github.com/repos/inveniosoftware/invenio/tags","blobs_url":"https://api.github.com/repos/inveniosoftware/invenio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/inveniosoftware/invenio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/inveniosoftware/invenio/git/refs{/sha}","trees_url":"https://api.github.com/repos/inveniosoftware/invenio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/inveniosoftware/invenio/statuses/{sha}","languages_url":"https://api.github.com/repos/inveniosoftware/invenio/languages","stargazers_url":"https://api.github.com/repos/inveniosoftware/invenio/stargazers","contributors_url":"https://api.github.com/repos/inveniosoftware/invenio/contributors","subscribers_url":"https://api.github.com/repos/inveniosoftware/invenio/subscribers","subscription_url":"https://api.github.com/repos/inveniosoftware/invenio/subscription","commits_url":"https://api.github.com/repos/inveniosoftware/invenio/commits{/sha}","git_commits_url":"https://api.github.com/repos/inveniosoftware/invenio/git/commits{/sha}","comments_url":"https://api.github.com/repos/inveniosoftware/invenio/comments{/number}","issue_comment_url":"https://api.github.com/repos/inveniosoftware/invenio/issues/comments/{number}","contents_url":"https://api.github.com/repos/inveniosoftware/invenio/contents/{+path}","compare_url":"https://api.github.com/repos/inveniosoftware/invenio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/inveniosoftware/invenio/merges","archive_url":"https://api.github.com/repos/inveniosoftware/invenio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/inveniosoftware/invenio/downloads","issues_url":"https://api.github.com/repos/inveniosoftware/invenio/issues{/number}","pulls_url":"https://api.github.com/repos/inveniosoftware/invenio/pulls{/number}","milestones_url":"https://api.github.com/repos/inveniosoftware/invenio/milestones{/number}","notifications_url":"https://api.github.com/repos/inveniosoftware/invenio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/inveniosoftware/invenio/labels{/name}","releases_url":"https://api.github.com/repos/inveniosoftware/invenio/releases{/id}","created_at":"2011-10-28T14:33:51Z","updated_at":"2014-11-08T11:42:18Z","pushed_at":"2014-11-17T14:47:22Z","git_url":"git://github.com/inveniosoftware/invenio.git","ssh_url":"git@github.com:inveniosoftware/invenio.git","clone_url":"https://github.com/inveniosoftware/invenio.git","svn_url":"https://github.com/inveniosoftware/invenio","homepage":"http://invenio-software.org/","size":89363,"stargazers_count":37,"watchers_count":37,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":104,"mirror_url":null,"open_issues_count":889,"forks":104,"open_issues":889,"watchers":37,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/inveniosoftware/invenio/pulls/2529"},"html":{"href":"https://github.com/inveniosoftware/invenio/pull/2529"},"issue":{"href":"https://api.github.com/repos/inveniosoftware/invenio/issues/2529"},"comments":{"href":"https://api.github.com/repos/inveniosoftware/invenio/issues/2529/comments"},"review_comments":{"href":"https://api.github.com/repos/inveniosoftware/invenio/pulls/2529/comments"},"review_comment":{"href":"https://api.github.com/repos/inveniosoftware/invenio/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/inveniosoftware/invenio/pulls/2529/commits"},"statuses":{"href":"https://api.github.com/repos/inveniosoftware/invenio/statuses/66174f570c6016b03b0dec76b9bb690b80cd0767"}}}}