Skip to content

Conversation

@nate-woythaler
Copy link

  • Properly handle updating tags if the page doesn't already have them
  • JSON-ify tags so Confluence can properly consume the data

Fixes #117

- Properly handle updating tags if the page doesn't already have them
- JSON-ify tags so Confluence can properly consume the data

Fixes iamjackg#117
return self._post(
f"content/{page.id}/label",
data=[{"name": label, "type": "global"} for label in labels],
data=json.dumps([{"name": label, "type": "global"} for label in labels]),
Copy link
Author

@nate-woythaler nate-woythaler Nov 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this is the correct approach, but our Confluence instance was giving me back HTTP 415s when submitting binary data via the **kwargs expansion on line 68

415 Client Error: Unsupported Media Type for url: https://${CONFLUENCE_URL}/rest/api/content/515736017/label - b''

@nate-woythaler
Copy link
Author

nate-woythaler commented Nov 13, 2023

  • TODO: fix tests

Chaining the `get` calls would mean a messy amount of Mocks. Just use a
single `get` call and if it's empty return a dummy struct for sanity's
sake.

Also `get('name')` on the returned struct since we run into issues with
Mocking without it.

Fixes iamjackg#117
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AttributeError when adding new tags to an existing page

1 participant