{"action":"created","issue":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/5464","repository_url":"https://api.github.com/repos/CenterForOpenScience/osf.io","labels_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/5464/labels{/name}","comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/5464/comments","events_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/5464/events","html_url":"https://github.com/CenterForOpenScience/osf.io/pull/5464","id":148077345,"number":5464,"title":"[rfr] Prevent changing attached DraftRegistration file","user":{"login":"barbour-em","id":8905795,"avatar_url":"https://avatars.githubusercontent.com/u/8905795?v=3","gravatar_id":"","url":"https://api.github.com/users/barbour-em","html_url":"https://github.com/barbour-em","followers_url":"https://api.github.com/users/barbour-em/followers","following_url":"https://api.github.com/users/barbour-em/following{/other_user}","gists_url":"https://api.github.com/users/barbour-em/gists{/gist_id}","starred_url":"https://api.github.com/users/barbour-em/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barbour-em/subscriptions","organizations_url":"https://api.github.com/users/barbour-em/orgs","repos_url":"https://api.github.com/users/barbour-em/repos","events_url":"https://api.github.com/users/barbour-em/events{/privacy}","received_events_url":"https://api.github.com/users/barbour-em/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":17,"created_at":"2016-04-13T14:22:27Z","updated_at":"2016-04-18T14:40:47Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/5464","html_url":"https://github.com/CenterForOpenScience/osf.io/pull/5464","diff_url":"https://github.com/CenterForOpenScience/osf.io/pull/5464.diff","patch_url":"https://github.com/CenterForOpenScience/osf.io/pull/5464.patch"},"body":"## Purpose\r\n\r\nPrevent users from changing an attached file when prereg form is in progress. \r\n\r\n## Changes\r\n- Any file attached to a DraftReg becomes \"checked-out\" when the preregistration form is submitted.\r\n- The files become \"checked-in\" when the registration is approved or sent back as rejected.\r\n- If the user tries to check-in an attached file before the DraftReg is approved, they receive a warning that this action will cancel their submission. If they continue, any DraftReg with that file attached will be rejected and all files attached to it become checked-in.\r\n\r\n## Side effects\r\n- Expose /reject/ route on front end. I don't like this so I'd like suggestions on the best way to handle it. \r\n- Checking in an attached file can do a lot if the user doesn't read the warning. \r\n\r\n## Ticket\r\nhttps://openscience.atlassian.net/browse/OSF-5585\r\nDepends on #5280"},"comment":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/comments/211408126","html_url":"https://github.com/CenterForOpenScience/osf.io/pull/5464#issuecomment-211408126","issue_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/5464","id":211408126,"user":{"login":"barbour-em","id":8905795,"avatar_url":"https://avatars.githubusercontent.com/u/8905795?v=3","gravatar_id":"","url":"https://api.github.com/users/barbour-em","html_url":"https://github.com/barbour-em","followers_url":"https://api.github.com/users/barbour-em/followers","following_url":"https://api.github.com/users/barbour-em/following{/other_user}","gists_url":"https://api.github.com/users/barbour-em/gists{/gist_id}","starred_url":"https://api.github.com/users/barbour-em/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barbour-em/subscriptions","organizations_url":"https://api.github.com/users/barbour-em/orgs","repos_url":"https://api.github.com/users/barbour-em/repos","events_url":"https://api.github.com/users/barbour-em/events{/privacy}","received_events_url":"https://api.github.com/users/barbour-em/received_events","type":"User","site_admin":false},"created_at":"2016-04-18T14:40:47Z","updated_at":"2016-04-18T14:40:47Z","body":"@whit537 Interestingly I'm having the permissions problem now too, I could approve before. I guess for now you could do\r\n(in `inv shell`)\r\n```\r\nIn[1]: from website.settings import PREREG_ADMIN_TAG\r\nIn[2]: user = models.User.load('ahn93')\r\nIn[3]: user.system_tags.append(PREREG_ADMIN_TAG)\r\nIn[4]: user.save()\r\nOut[4]: {'system_tags'}\r\nIn[5]: commit()\r\nTransaction committed.\r\nNew transaction opened\r\n```\r\n\r\nThis fixed the issue for me"}}