You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Try creating a new tenure relationship via the API; use POST /api/v1/organizations/{organization_slug}/projects/{project_slug}/relationships/tenure/
Actual behavior
jsonattrs throws exception AttributeError: 'str' object has no attribute 'keys'. It seems that the attributes JSON is provided as a string instead of a dict. See Opbeat error E#30 on Platform-staging for more context information.
Expected behavior
A new relationship is created, 201 response including relationship details should be returned.
The text was updated successfully, but these errors were encountered:
It seems like this might be something to do with formatting of JSON POST bodies by the API explorer being used here. It may be that it's providing a structured JSON object for the attributes as a string. For instance, using HTTPie, something like this works (using a form with some relationship attributes that include a test_int field):
Note that the attributes argument to HTTPie is written as attributes:=blah instead of just attributes=blah. That forces HTTPie to interpret the value after the := as structured JSON data, not just a string. I'm guessing that if you use one of the browser API explorer things, it might be harder to get it to send structured data in the request body. If that data (which should be a dictionary) really is being sent as a string, that would explain the error being generated here.
Steps to reproduce the error
Try creating a new tenure relationship via the API; use
POST /api/v1/organizations/{organization_slug}/projects/{project_slug}/relationships/tenure/
Actual behavior
jsonattrs throws exception
AttributeError: 'str' object has no attribute 'keys'
. It seems that the attributes JSON is provided as astring
instead of adict
. See Opbeat error E#30 on Platform-staging for more context information.Expected behavior
A new relationship is created,
201
response including relationship details should be returned.The text was updated successfully, but these errors were encountered: