Skip to content

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 the form_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.
  • scout_manager/views/pages.py
    • Set netid to test always. See point above about Auth for the reasoning.

Please review: @NUWAN.KUMARASIRI @TREFILEK @bjsousa

Merge request reports

Loading