{"action":"created","comment":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments/36534943","id":36534943,"diff_hunk":"@@ -0,0 +1,16 @@\n+Hello ${user.fullname},\n+\n+\n+We just wanted to let you know that ${initiated_by} has initiated the following pending registration: ${registration_link}\n+\n+To approve this action click the following link: ${approval_link}\n+\n+To disapprove this action, click the following link: ${disapproval_link}\n+\n+Note: Clicking the disapproval link will immediately cancel the pending registration. If you neither approve nor disapprove\n+the registration within ${approval_time_span} hours of midnight tonight (EDT) the registration will become automatically\n+approved. This operation is irreversible.\n+\n+Sincerely yours,\n+\n+The OSF Robots","path":"website/templates/emails/pending_registration_admin.txt.mako","position":16,"original_position":16,"commit_id":"84171915041165e33339098f149ac19af08536c3","original_commit_id":"84171915041165e33339098f149ac19af08536c3","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":"We use \r\n\r\n- \"The Open Science Framework Robots\"\r\n- \"The OSF Robot\"\r\n- \"Open Science Framework Robot\"\r\n- \"The OSF Robots\"\r\n- \"The OSF Team\"\r\n\r\nin different emails. Which is preferred? @jlcohoon @erinmayhood ","created_at":"2015-08-07T16:20:51Z","updated_at":"2015-08-07T16:20:51Z","html_url":"https://github.com/CenterForOpenScience/osf.io/pull/3919#discussion_r36534943","pull_request_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/3919","_links":{"self":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments/36534943"},"html":{"href":"https://github.com/CenterForOpenScience/osf.io/pull/3919#discussion_r36534943"},"pull_request":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/3919"}}},"pull_request":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/3919","id":41503843,"html_url":"https://github.com/CenterForOpenScience/osf.io/pull/3919","diff_url":"https://github.com/CenterForOpenScience/osf.io/pull/3919.diff","patch_url":"https://github.com/CenterForOpenScience/osf.io/pull/3919.patch","issue_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/3919","number":3919,"state":"open","locked":false,"title":"[Ready for Review] Registration Approvals","user":{"login":"samchrisinger","id":2207561,"avatar_url":"https://avatars.githubusercontent.com/u/2207561?v=3","gravatar_id":"","url":"https://api.github.com/users/samchrisinger","html_url":"https://github.com/samchrisinger","followers_url":"https://api.github.com/users/samchrisinger/followers","following_url":"https://api.github.com/users/samchrisinger/following{/other_user}","gists_url":"https://api.github.com/users/samchrisinger/gists{/gist_id}","starred_url":"https://api.github.com/users/samchrisinger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samchrisinger/subscriptions","organizations_url":"https://api.github.com/users/samchrisinger/orgs","repos_url":"https://api.github.com/users/samchrisinger/repos","events_url":"https://api.github.com/users/samchrisinger/events{/privacy}","received_events_url":"https://api.github.com/users/samchrisinger/received_events","type":"User","site_admin":false},"body":"_[Associated Proposal](https://docs.google.com/document/d/1_zOgOvbAphIuj2A3L2Hg0rXP83xxAzCc0uAKRIF0bIs/edit#heading=h.4mazeeocviis)_\r\n\r\n# Purpose\r\n\r\nCommunity has requested that (to match the embargo behavior) all registrations require approval by administrators.  \r\n\r\nThere was already some (backend) redundancy with how embargoes and retractions were handled and a future need for generalized approval behavior (Prereg), so this seemed like an opportune time to generalize some of our infrastructure while simultaneously adding the requested registration approval behavior.\r\n\r\n# Changes\r\n\r\n- Add Sanction class as a generic representation of a stateful approval of some action\r\n- Add EmailApprovableSanction to generalize email-specific behavior shared by Embargo, Retraction\r\n- Add RegistrationApproval as a subclass of EmailApprovableSanction \r\n- Update embargo/retraction/registration views to use this new abstraction\r\n- Update Archiver to use new abstraction\r\n- Fix old tests\r\n- Add new tests for Sanction and EmailApprovableSanction\r\n\r\n# Side Effects\r\n\r\nThis touches Embargoes and Retractions. I'm confident in the quality of the unit tests in place as well as the newly added tests, but we should confirm that this functionally still works as expected. \r\n\r\nAdditionally now any time a project is registered and the associated archival task completes that registration will remain private until approved, or after they remain unapproved for 48 hours. An approval email is sent to every project admin, and a notification email is sent to every non-admin collaborator. This functionality mirrors Embargoes/Retractions as closely as possible. \r\n\r\nWe have also added logs for:\r\n- registration initiated\r\n- registration approved\r\n- registration rejected\r\n\r\nTODOs\r\n\r\n- [x] Implement generic approval class\r\n- [x] Make Embargo and Retraction subclasses of generic approval class\r\n- [x] Implement RegistrationApproval class\r\n- [x] Implement views to support registration approvals\r\n- [x] Add registration approval logs and log templates\r\n  - [x] add tests for new logs and log templates\r\n- [x] Add registration approval email templates\r\n- [x] Fix the tests\r\n- [x] Add tests for new code\r\n- [x] Add cron scripts for auto-approval of registrations\r\n- [x] @HarryRybacki add pending_registration_approval to Node serialization and to mako templates","created_at":"2015-08-03T20:02:16Z","updated_at":"2015-08-07T16:20:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"56cebbb9326ce1751c15536e1442e4d668758057","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/3919/commits","review_comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/3919/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/3919/comments","statuses_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/84171915041165e33339098f149ac19af08536c3","head":{"label":"samchrisinger:feature/approvals","ref":"feature/approvals","sha":"84171915041165e33339098f149ac19af08536c3","user":{"login":"samchrisinger","id":2207561,"avatar_url":"https://avatars.githubusercontent.com/u/2207561?v=3","gravatar_id":"","url":"https://api.github.com/users/samchrisinger","html_url":"https://github.com/samchrisinger","followers_url":"https://api.github.com/users/samchrisinger/followers","following_url":"https://api.github.com/users/samchrisinger/following{/other_user}","gists_url":"https://api.github.com/users/samchrisinger/gists{/gist_id}","starred_url":"https://api.github.com/users/samchrisinger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samchrisinger/subscriptions","organizations_url":"https://api.github.com/users/samchrisinger/orgs","repos_url":"https://api.github.com/users/samchrisinger/repos","events_url":"https://api.github.com/users/samchrisinger/events{/privacy}","received_events_url":"https://api.github.com/users/samchrisinger/received_events","type":"User","site_admin":false},"repo":{"id":30772672,"name":"osf.io","full_name":"samchrisinger/osf.io","owner":{"login":"samchrisinger","id":2207561,"avatar_url":"https://avatars.githubusercontent.com/u/2207561?v=3","gravatar_id":"","url":"https://api.github.com/users/samchrisinger","html_url":"https://github.com/samchrisinger","followers_url":"https://api.github.com/users/samchrisinger/followers","following_url":"https://api.github.com/users/samchrisinger/following{/other_user}","gists_url":"https://api.github.com/users/samchrisinger/gists{/gist_id}","starred_url":"https://api.github.com/users/samchrisinger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samchrisinger/subscriptions","organizations_url":"https://api.github.com/users/samchrisinger/orgs","repos_url":"https://api.github.com/users/samchrisinger/repos","events_url":"https://api.github.com/users/samchrisinger/events{/privacy}","received_events_url":"https://api.github.com/users/samchrisinger/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/samchrisinger/osf.io","description":"Facilitating Open Science","fork":true,"url":"https://api.github.com/repos/samchrisinger/osf.io","forks_url":"https://api.github.com/repos/samchrisinger/osf.io/forks","keys_url":"https://api.github.com/repos/samchrisinger/osf.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/samchrisinger/osf.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/samchrisinger/osf.io/teams","hooks_url":"https://api.github.com/repos/samchrisinger/osf.io/hooks","issue_events_url":"https://api.github.com/repos/samchrisinger/osf.io/issues/events{/number}","events_url":"https://api.github.com/repos/samchrisinger/osf.io/events","assignees_url":"https://api.github.com/repos/samchrisinger/osf.io/assignees{/user}","branches_url":"https://api.github.com/repos/samchrisinger/osf.io/branches{/branch}","tags_url":"https://api.github.com/repos/samchrisinger/osf.io/tags","blobs_url":"https://api.github.com/repos/samchrisinger/osf.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/samchrisinger/osf.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/samchrisinger/osf.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/samchrisinger/osf.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/samchrisinger/osf.io/statuses/{sha}","languages_url":"https://api.github.com/repos/samchrisinger/osf.io/languages","stargazers_url":"https://api.github.com/repos/samchrisinger/osf.io/stargazers","contributors_url":"https://api.github.com/repos/samchrisinger/osf.io/contributors","subscribers_url":"https://api.github.com/repos/samchrisinger/osf.io/subscribers","subscription_url":"https://api.github.com/repos/samchrisinger/osf.io/subscription","commits_url":"https://api.github.com/repos/samchrisinger/osf.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/samchrisinger/osf.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/samchrisinger/osf.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/samchrisinger/osf.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/samchrisinger/osf.io/contents/{+path}","compare_url":"https://api.github.com/repos/samchrisinger/osf.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/samchrisinger/osf.io/merges","archive_url":"https://api.github.com/repos/samchrisinger/osf.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/samchrisinger/osf.io/downloads","issues_url":"https://api.github.com/repos/samchrisinger/osf.io/issues{/number}","pulls_url":"https://api.github.com/repos/samchrisinger/osf.io/pulls{/number}","milestones_url":"https://api.github.com/repos/samchrisinger/osf.io/milestones{/number}","notifications_url":"https://api.github.com/repos/samchrisinger/osf.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/samchrisinger/osf.io/labels{/name}","releases_url":"https://api.github.com/repos/samchrisinger/osf.io/releases{/id}","created_at":"2015-02-13T19:40:14Z","updated_at":"2015-02-27T18:03:37Z","pushed_at":"2015-08-07T15:48:55Z","git_url":"git://github.com/samchrisinger/osf.io.git","ssh_url":"git@github.com:samchrisinger/osf.io.git","clone_url":"https://github.com/samchrisinger/osf.io.git","svn_url":"https://github.com/samchrisinger/osf.io","homepage":"http://osf.io","size":100481,"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":"96062b92c34cb14779e25fb86747f7e112604d6d","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}","created_at":"2013-05-21T15:53:37Z","updated_at":"2015-08-05T16:17:51Z","pushed_at":"2015-08-07T16:16:38Z","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":221476,"stargazers_count":125,"watchers_count":125,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":107,"mirror_url":null,"open_issues_count":514,"forks":107,"open_issues":514,"watchers":125,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/3919"},"html":{"href":"https://github.com/CenterForOpenScience/osf.io/pull/3919"},"issue":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/3919"},"comments":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/3919/comments"},"review_comments":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/3919/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/3919/commits"},"statuses":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/84171915041165e33339098f149ac19af08536c3"}}}}