{"action":"created","issue":{"url":"https://api.github.com/repos/Scifabric/pybossa/issues/1676","repository_url":"https://api.github.com/repos/Scifabric/pybossa","labels_url":"https://api.github.com/repos/Scifabric/pybossa/issues/1676/labels{/name}","comments_url":"https://api.github.com/repos/Scifabric/pybossa/issues/1676/comments","events_url":"https://api.github.com/repos/Scifabric/pybossa/issues/1676/events","html_url":"https://github.com/Scifabric/pybossa/issues/1676","id":261243348,"number":1676,"title":"redirect_content_type doesn't work when uploading images","user":{"login":"alexandermendes","id":5636273,"avatar_url":"https://avatars1.githubusercontent.com/u/5636273?v=4","gravatar_id":"","url":"https://api.github.com/users/alexandermendes","html_url":"https://github.com/alexandermendes","followers_url":"https://api.github.com/users/alexandermendes/followers","following_url":"https://api.github.com/users/alexandermendes/following{/other_user}","gists_url":"https://api.github.com/users/alexandermendes/gists{/gist_id}","starred_url":"https://api.github.com/users/alexandermendes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexandermendes/subscriptions","organizations_url":"https://api.github.com/users/alexandermendes/orgs","repos_url":"https://api.github.com/users/alexandermendes/repos","events_url":"https://api.github.com/users/alexandermendes/events{/privacy}","received_events_url":"https://api.github.com/users/alexandermendes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-09-28T09:01:03Z","updated_at":"2017-09-29T08:41:44Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"As stated in the docs, when uploading images via the API (at `/account/<name>/update` and `/project/<short_name>/update`) we can't sent the content type to JSON. I finally managed to get image uploads working via the API but at each of those endpoints, as we're using [handle_content_type](https://github.com/Scifabric/pybossa/blob/167577773a7308df03e1b611509d86f0ed52c5bb/pybossa/util.py#L63), we don't get the correct response back. Ideally we would still get a JSON response back, with any flash messages etc. Not sure about the solution yet but I guess we need some fix there!"},"comment":{"url":"https://api.github.com/repos/Scifabric/pybossa/issues/comments/333068062","html_url":"https://github.com/Scifabric/pybossa/issues/1676#issuecomment-333068062","issue_url":"https://api.github.com/repos/Scifabric/pybossa/issues/1676","id":333068062,"user":{"login":"teleyinex","id":131838,"avatar_url":"https://avatars2.githubusercontent.com/u/131838?v=4","gravatar_id":"","url":"https://api.github.com/users/teleyinex","html_url":"https://github.com/teleyinex","followers_url":"https://api.github.com/users/teleyinex/followers","following_url":"https://api.github.com/users/teleyinex/following{/other_user}","gists_url":"https://api.github.com/users/teleyinex/gists{/gist_id}","starred_url":"https://api.github.com/users/teleyinex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teleyinex/subscriptions","organizations_url":"https://api.github.com/users/teleyinex/orgs","repos_url":"https://api.github.com/users/teleyinex/repos","events_url":"https://api.github.com/users/teleyinex/events{/privacy}","received_events_url":"https://api.github.com/users/teleyinex/received_events","type":"User","site_admin":false},"created_at":"2017-09-29T08:41:44Z","updated_at":"2017-09-29T08:41:44Z","author_association":"OWNER","body":"The issue has been the following, when you upload an image you have to setup the content type to multipart form. This does not allowed us to identify if you were coming from an SPA or a regular form. The solution I think is to have an argument like this:\r\n\r\n/account/<name>/update?format=json <- will return the output as JSON while if we don't include that argument it will return regular HTML. What do you think?"}}
{"actor":{"display_login":"teleyinex"}}