webcompat.com
webcompat.com copied to clipboard
Give similar shapes to api_request and proxy_request
proxy_request and api_request do not return the same type of object
This creates unnecessary difficulties, such as seen in #3606 and #3607
https://github.com/webcompat/webcompat.com/blob/e5dbd1c8ea33e329dd5e295268c2f0717aa9f7dc/webcompat/helpers.py#L459-L481
https://github.com/webcompat/webcompat.com/blob/e5dbd1c8ea33e329dd5e295268c2f0717aa9f7dc/webcompat/helpers.py#L436-L456
so when we reach, the object is not working
https://github.com/webcompat/webcompat.com/blob/e5dbd1c8ea33e329dd5e295268c2f0717aa9f7dc/webcompat/api/endpoints.py#L68-L70
The request has been correctly sent but the answers is not in the format we expect.
This is the shape of the content we receive once going through api_request, a tuple with 3 values.
While the edit.content, edit.status_code is trying to access properties of an object, this can be fixed with a quick hack testing the nature, the type of edit
Originally posted by @karlcow in https://github.com/webcompat/webcompat.com/issues/3606#issuecomment-884579305
proxy_request returns a Response object.