Fix POSTing Spot images
This PR fixes how form data is handled when an image is uploaded for a Spot.
Detailed breakdown
-
scout_manager/dao/groups.py
- Comment out Group handling and just allow everything through. Authentication and Authorization is something we'll have to start thinking about.
-
scout_manager/views/api.py
- The main business- Check if Exception subclasses have a
message
attribute, otherwise just convert the Exception into a string. -
Fix form/image handling. Rather than parsing the PUT data manually like the code was originally doing, we now coerce the PUT back into a POST, call
_load_post_and_files
(private API, as denoted by the_
prefix), and coerce the request back into a PUT, creating theform_data
dict with the Django parsed body and files. All of the manual parsing stems from an old, unknown Django bug (from what I can tell) which led them to doing this as a PUT in the first place.
- Check if Exception subclasses have a
-
scout_manager/views/pages.py
- Set
netid
totest
always. See point above about Auth for the reasoning.
- Set
Please review: @NUWAN.KUMARASIRI @TREFILEK @bjsousa