{"action":"created","comment":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments/62734556","id":62734556,"diff_hunk":"@@ -26,14 +26,18 @@ def get_targets():\n \n \n def fix_embargo_approved_logs(targets):\n+    count = 0\n     for log in targets:\n         node_id = log.params['node']\n         node = Node.load(node_id)\n         if node.is_registration:\n+            log_params = log.params\n             log.params['node'] = node.registered_from_id\n             log.params['registration'] = node._id\n+            logger.info('Updating params of log {} from {} to {}'.format(log._id, log_params, log.params))\n             log.save()\n-            logging.debug('Updated node param of log {}'.format(log._id))\n+            count += 1\n+    logger.info('{} logs migrated').format(count)","path":"scripts/fix_embargo_approved_logs.py","position":null,"original_position":16,"commit_id":"a64424f49260ac323c418adce811f642d1466bac","original_commit_id":"a64424f49260ac323c418adce811f642d1466bac","user":{"login":"sloria","id":2379650,"avatar_url":"https://avatars.githubusercontent.com/u/2379650?v=3","gravatar_id":"","url":"https://api.github.com/users/sloria","html_url":"https://github.com/sloria","followers_url":"https://api.github.com/users/sloria/followers","following_url":"https://api.github.com/users/sloria/following{/other_user}","gists_url":"https://api.github.com/users/sloria/gists{/gist_id}","starred_url":"https://api.github.com/users/sloria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sloria/subscriptions","organizations_url":"https://api.github.com/users/sloria/orgs","repos_url":"https://api.github.com/users/sloria/repos","events_url":"https://api.github.com/users/sloria/events{/privacy}","received_events_url":"https://api.github.com/users/sloria/received_events","type":"User","site_admin":false},"body":"Typo here: `.format` needs to be called on the string; will fix when I merge.","created_at":"2016-05-10T19:16:58Z","updated_at":"2016-05-10T19:16:58Z","html_url":"https://github.com/CenterForOpenScience/osf.io/pull/5558#discussion_r62734556","pull_request_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/5558","_links":{"self":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments/62734556"},"html":{"href":"https://github.com/CenterForOpenScience/osf.io/pull/5558#discussion_r62734556"},"pull_request":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/5558"}}},"pull_request":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/5558","id":68236513,"html_url":"https://github.com/CenterForOpenScience/osf.io/pull/5558","diff_url":"https://github.com/CenterForOpenScience/osf.io/pull/5558.diff","patch_url":"https://github.com/CenterForOpenScience/osf.io/pull/5558.patch","issue_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/5558","number":5558,"state":"open","locked":false,"title":"[Feature] Fix embargo logs [OSF-6005]","user":{"login":"samanehsan","id":6414394,"avatar_url":"https://avatars.githubusercontent.com/u/6414394?v=3","gravatar_id":"","url":"https://api.github.com/users/samanehsan","html_url":"https://github.com/samanehsan","followers_url":"https://api.github.com/users/samanehsan/followers","following_url":"https://api.github.com/users/samanehsan/following{/other_user}","gists_url":"https://api.github.com/users/samanehsan/gists{/gist_id}","starred_url":"https://api.github.com/users/samanehsan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samanehsan/subscriptions","organizations_url":"https://api.github.com/users/samanehsan/orgs","repos_url":"https://api.github.com/users/samanehsan/repos","events_url":"https://api.github.com/users/samanehsan/events{/privacy}","received_events_url":"https://api.github.com/users/samanehsan/received_events","type":"User","site_admin":false},"body":"## Purpose\r\n\r\nLogs about registration actions should link to the registered project. Eg. Instead of \"Embargo for {Registration} approved, the log should say \"Embargo of registration of {Project} approved.\"\r\n\r\n## Changes\r\n\r\n- Change the \"embargo_approved_no_user\" log to \"Embargo of registration of {Project} approved\" and pass in the registered project instead of the registration in the `embargo_registrations.py` script.\r\n- Change the \"embargo_completed_no_user\" log to \"Embargo of registration of {Project} completed\"\r\n(the registered project is already being passed to the log).\r\n- Remove the unused \"embargo_completed\" log, since embargo completion is currently done automatically\r\n\r\n## Side effects\r\nNone.\r\n\r\n\r\n## Ticket\r\nhttps://openscience.atlassian.net/browse/OSF-6005\r\n","created_at":"2016-04-28T15:04:16Z","updated_at":"2016-05-10T19:16:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5298404434f6d3988f63cb06b29dacfaed6783e2","assignee":null,"milestone":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/milestones/74","html_url":"https://github.com/CenterForOpenScience/osf.io/milestones/0.73.0","labels_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/milestones/74/labels","id":1743434,"number":74,"title":"0.73.0","description":"","creator":{"login":"sloria","id":2379650,"avatar_url":"https://avatars.githubusercontent.com/u/2379650?v=3","gravatar_id":"","url":"https://api.github.com/users/sloria","html_url":"https://github.com/sloria","followers_url":"https://api.github.com/users/sloria/followers","following_url":"https://api.github.com/users/sloria/following{/other_user}","gists_url":"https://api.github.com/users/sloria/gists{/gist_id}","starred_url":"https://api.github.com/users/sloria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sloria/subscriptions","organizations_url":"https://api.github.com/users/sloria/orgs","repos_url":"https://api.github.com/users/sloria/repos","events_url":"https://api.github.com/users/sloria/events{/privacy}","received_events_url":"https://api.github.com/users/sloria/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":16,"state":"open","created_at":"2016-05-02T20:41:00Z","updated_at":"2016-05-10T18:38:37Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/5558/commits","review_comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/5558/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/5558/comments","statuses_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/a64424f49260ac323c418adce811f642d1466bac","head":{"label":"samanehsan:feature/fix-embargo-logs","ref":"feature/fix-embargo-logs","sha":"a64424f49260ac323c418adce811f642d1466bac","user":{"login":"samanehsan","id":6414394,"avatar_url":"https://avatars.githubusercontent.com/u/6414394?v=3","gravatar_id":"","url":"https://api.github.com/users/samanehsan","html_url":"https://github.com/samanehsan","followers_url":"https://api.github.com/users/samanehsan/followers","following_url":"https://api.github.com/users/samanehsan/following{/other_user}","gists_url":"https://api.github.com/users/samanehsan/gists{/gist_id}","starred_url":"https://api.github.com/users/samanehsan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samanehsan/subscriptions","organizations_url":"https://api.github.com/users/samanehsan/orgs","repos_url":"https://api.github.com/users/samanehsan/repos","events_url":"https://api.github.com/users/samanehsan/events{/privacy}","received_events_url":"https://api.github.com/users/samanehsan/received_events","type":"User","site_admin":false},"repo":{"id":26921095,"name":"osf.io","full_name":"samanehsan/osf.io","owner":{"login":"samanehsan","id":6414394,"avatar_url":"https://avatars.githubusercontent.com/u/6414394?v=3","gravatar_id":"","url":"https://api.github.com/users/samanehsan","html_url":"https://github.com/samanehsan","followers_url":"https://api.github.com/users/samanehsan/followers","following_url":"https://api.github.com/users/samanehsan/following{/other_user}","gists_url":"https://api.github.com/users/samanehsan/gists{/gist_id}","starred_url":"https://api.github.com/users/samanehsan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samanehsan/subscriptions","organizations_url":"https://api.github.com/users/samanehsan/orgs","repos_url":"https://api.github.com/users/samanehsan/repos","events_url":"https://api.github.com/users/samanehsan/events{/privacy}","received_events_url":"https://api.github.com/users/samanehsan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/samanehsan/osf.io","description":"Facilitating Open Science","fork":true,"url":"https://api.github.com/repos/samanehsan/osf.io","forks_url":"https://api.github.com/repos/samanehsan/osf.io/forks","keys_url":"https://api.github.com/repos/samanehsan/osf.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/samanehsan/osf.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/samanehsan/osf.io/teams","hooks_url":"https://api.github.com/repos/samanehsan/osf.io/hooks","issue_events_url":"https://api.github.com/repos/samanehsan/osf.io/issues/events{/number}","events_url":"https://api.github.com/repos/samanehsan/osf.io/events","assignees_url":"https://api.github.com/repos/samanehsan/osf.io/assignees{/user}","branches_url":"https://api.github.com/repos/samanehsan/osf.io/branches{/branch}","tags_url":"https://api.github.com/repos/samanehsan/osf.io/tags","blobs_url":"https://api.github.com/repos/samanehsan/osf.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/samanehsan/osf.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/samanehsan/osf.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/samanehsan/osf.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/samanehsan/osf.io/statuses/{sha}","languages_url":"https://api.github.com/repos/samanehsan/osf.io/languages","stargazers_url":"https://api.github.com/repos/samanehsan/osf.io/stargazers","contributors_url":"https://api.github.com/repos/samanehsan/osf.io/contributors","subscribers_url":"https://api.github.com/repos/samanehsan/osf.io/subscribers","subscription_url":"https://api.github.com/repos/samanehsan/osf.io/subscription","commits_url":"https://api.github.com/repos/samanehsan/osf.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/samanehsan/osf.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/samanehsan/osf.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/samanehsan/osf.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/samanehsan/osf.io/contents/{+path}","compare_url":"https://api.github.com/repos/samanehsan/osf.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/samanehsan/osf.io/merges","archive_url":"https://api.github.com/repos/samanehsan/osf.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/samanehsan/osf.io/downloads","issues_url":"https://api.github.com/repos/samanehsan/osf.io/issues{/number}","pulls_url":"https://api.github.com/repos/samanehsan/osf.io/pulls{/number}","milestones_url":"https://api.github.com/repos/samanehsan/osf.io/milestones{/number}","notifications_url":"https://api.github.com/repos/samanehsan/osf.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/samanehsan/osf.io/labels{/name}","releases_url":"https://api.github.com/repos/samanehsan/osf.io/releases{/id}","deployments_url":"https://api.github.com/repos/samanehsan/osf.io/deployments","created_at":"2014-11-20T16:27:37Z","updated_at":"2015-06-24T13:47:24Z","pushed_at":"2016-05-10T18:53:13Z","git_url":"git://github.com/samanehsan/osf.io.git","ssh_url":"git@github.com:samanehsan/osf.io.git","clone_url":"https://github.com/samanehsan/osf.io.git","svn_url":"https://github.com/samanehsan/osf.io","homepage":"http://osf.io","size":129010,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"base":{"label":"CenterForOpenScience:develop","ref":"develop","sha":"7dcf7684e80f49cd21f689084f5b0b68cda525f0","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-05-09T05:46:57Z","pushed_at":"2016-05-10T19:11:26Z","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":275617,"stargazers_count":220,"watchers_count":220,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":167,"mirror_url":null,"open_issues_count":216,"forks":167,"open_issues":216,"watchers":220,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/5558"},"html":{"href":"https://github.com/CenterForOpenScience/osf.io/pull/5558"},"issue":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/5558"},"comments":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/5558/comments"},"review_comments":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/5558/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/5558/commits"},"statuses":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/a64424f49260ac323c418adce811f642d1466bac"}}}}