mitodl / micromasters

Portal for learners and course teams to access MITx Micromasters® programs
https://mm.mit.edu
BSD 3-Clause "New" or "Revised" License
29 stars 17 forks source link

Error when uploading a file from Android #2029

Open noisecapella opened 7 years ago

noisecapella commented 7 years ago

I usually upload a photo shared using the Camera app. This time I tried to upload a photo which was saved to the phone beforehand. I am able to get the cropper to make a selection but when uploading it, it fails to replace the image. We should show some kind of error message for these cases, and we should fix whatever is the root cause here. From heroku logs:

2016-12-07T20:54:26.155892+00:00 app[web.1]: An exception was intercepted by custom_exception_handler
2016-12-07T20:54:26.155898+00:00 app[web.1]: Traceback (most recent call last):
2016-12-07T20:54:26.155899+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.5/site-packages/rest_framework/views.py", line 474, in dispatch
2016-12-07T20:54:26.155900+00:00 app[web.1]:     response = handler(request, *args, **kwargs)
2016-12-07T20:54:26.155903+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.5/site-packages/rest_framework/mixins.py", line 85, in partial_update
2016-12-07T20:54:26.155903+00:00 app[web.1]:     return self.update(request, *args, **kwargs)
2016-12-07T20:54:26.155904+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.5/site-packages/rest_framework/mixins.py", line 69, in update
2016-12-07T20:54:26.155905+00:00 app[web.1]:     serializer.is_valid(raise_exception=True)
2016-12-07T20:54:26.155906+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.5/site-packages/rest_framework/serializers.py", line 244, in is_valid
2016-12-07T20:54:26.155906+00:00 app[web.1]:     raise ValidationError(self.errors)
2016-12-07T20:54:26.155911+00:00 app[web.1]: rest_framework.exceptions.ValidationError: {'image': ['The submitted data was not a file. Check the encoding type on the form.']}
alicewriteswrongs commented 7 years ago

how reliably does this happen? could you try out the PR build for my resizing change and see if it repros there?

its here: https://micromasters-ci-pr-2004.herokuapp.com/

noisecapella commented 7 years ago

It seems to happen when I just upload the image and don't touch the cropper. I'll try the pr build

noisecapella commented 7 years ago

When I do this from that PR build it clears the image entirely: screenshot_20161208-101536