Skip to content
This repository was archived by the owner on Dec 27, 2018. It is now read-only.

Adding 'wiki' representation for 'convert_contentbody_to_new_type'. #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion PythonConfluenceAPI/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1122,6 +1122,7 @@ def convert_contentbody_to_new_type(self, content_data, old_representation, new_
--------------------------------------------------------------
"storage" | "view","export_view","editor"
"editor" | "storage"
"wiki" | "storage"
"view" | None
"export_view" | None

Expand All @@ -1133,7 +1134,7 @@ def convert_contentbody_to_new_type(self, content_data, old_representation, new_
:return: The JSON data returned from the contentbody/convert/{to} endpoint,
or the results of the callback. Will raise requests.HTTPError on bad input, potentially.
"""
assert {old_representation, new_representation} < {"storage", "editor", "view", "export_view"}
assert {old_representation, new_representation} < {"storage", "editor", "view", "export_view", "wiki"}
# TODO: Enforce conversion rules better here.
request_data = {"value": str(content_data), "representation": old_representation}
return self._service_post_request("rest/api/contentbody/convert/{to}".format(to=new_representation),
Expand Down