{"action":"created","issue":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/3052","labels_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/3052/labels{/name}","comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/3052/comments","events_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/3052/events","html_url":"https://github.com/CenterForOpenScience/osf.io/pull/3052","id":87083491,"number":3052,"title":"[WIP] API registration creation","user":{"login":"pattisdr","id":9755598,"avatar_url":"https://avatars.githubusercontent.com/u/9755598?v=3","gravatar_id":"","url":"https://api.github.com/users/pattisdr","html_url":"https://github.com/pattisdr","followers_url":"https://api.github.com/users/pattisdr/followers","following_url":"https://api.github.com/users/pattisdr/following{/other_user}","gists_url":"https://api.github.com/users/pattisdr/gists{/gist_id}","starred_url":"https://api.github.com/users/pattisdr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pattisdr/subscriptions","organizations_url":"https://api.github.com/users/pattisdr/orgs","repos_url":"https://api.github.com/users/pattisdr/repos","events_url":"https://api.github.com/users/pattisdr/events{/privacy}","received_events_url":"https://api.github.com/users/pattisdr/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/labels/Core:%20API%20v2","name":"Core: API v2","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-06-10T19:45:19Z","updated_at":"2015-06-15T14:36:02Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/3052","html_url":"https://github.com/CenterForOpenScience/osf.io/pull/3052","diff_url":"https://github.com/CenterForOpenScience/osf.io/pull/3052.diff","patch_url":"https://github.com/CenterForOpenScience/osf.io/pull/3052.patch"},"body":"<h1> Purpose </h1>\r\nRegarding Issue #3046, this code allows users to create registrations through the API through a two-step process.  To confirm the user wishes to register the project, the user is preventing from POSTing all in one go. <ol>\r\n\r\n<li> User sends a POST request containing supplemental registration information. </li>\r\n<li> Server returns 400 error with a message telling them they are about to register the project along with a new URL containing a token. </li>\r\n<li> User submits second POST request, this time to new URL, containing supplemental registration information. </li>\r\n<li> Registration is created provided tokens match. </li>\r\n</ol>\r\n\r\n<h1> Changes </h1>\r\n<ul>\r\n<li> Added eight new URL's to api/nodes/urls.py\r\n\r\n . There are currently 4 registration types, with 2 URL's each, one with token and one without. </li>\r\n<li> Added a token creator to api/base/utils.py, which generates the token attached to the second URL.\r\n<li> Added views to api/nodes/views.py.  The current views are separated because condensing them into one view calling different serializers for different URL's affects the Swagger documentation. </li>\r\n<li> Added serializers to api/nodes/serializers.py </li>\r\n<li> Added to website/language.py and api/base/settings/defaults.py for warning message and enabling message to be translatable </li>\r\n<li> Added tests for registration creation at test_views.py </li> \r\n\r\n</ul>\r\n\r\n\r\n<h1> Side Effects </h1>\r\n<ul>\r\n<li> Eight new POST operations in Swagger documentation </li>\r\n![screen shot 2015-06-10 at 3 34 06 pm](https://cloud.githubusercontent.com/assets/9755598/8092194/37ca8632-0f86-11e5-9014-c8952665a135.png)\r\n\r\n<li>  User submits supplemental registration information along with request. Submitting the initial POST request for an OSF-Standard Pre-Data Collection Registration is shown here, for example. </li>\r\n![screen shot 2015-06-10 at 3 36 31 pm](https://cloud.githubusercontent.com/assets/9755598/8092286/bddb6a8e-0f86-11e5-9a03-491a26c7f8e8.png)\r\n"},"comment":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/comments/112091277","html_url":"https://github.com/CenterForOpenScience/osf.io/pull/3052#issuecomment-112091277","issue_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/3052","id":112091277,"user":{"login":"brianjgeiger","id":6599111,"avatar_url":"https://avatars.githubusercontent.com/u/6599111?v=3","gravatar_id":"","url":"https://api.github.com/users/brianjgeiger","html_url":"https://github.com/brianjgeiger","followers_url":"https://api.github.com/users/brianjgeiger/followers","following_url":"https://api.github.com/users/brianjgeiger/following{/other_user}","gists_url":"https://api.github.com/users/brianjgeiger/gists{/gist_id}","starred_url":"https://api.github.com/users/brianjgeiger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brianjgeiger/subscriptions","organizations_url":"https://api.github.com/users/brianjgeiger/orgs","repos_url":"https://api.github.com/users/brianjgeiger/repos","events_url":"https://api.github.com/users/brianjgeiger/events{/privacy}","received_events_url":"https://api.github.com/users/brianjgeiger/received_events","type":"User","site_admin":false},"created_at":"2015-06-15T14:36:02Z","updated_at":"2015-06-15T14:36:02Z","body":"Looks like we're not using an import. Could you fix that? Thanks!\r\n\r\n![screen shot 2015-06-15 at 10 35 30 am](https://cloud.githubusercontent.com/assets/6599111/8162293/507787bc-134a-11e5-90ba-6da61520816c.png)\r\n"}}