Skip to content
Snippets Groups Projects
Verified Commit 7359c31f authored by Robin Sonnabend's avatar Robin Sonnabend
Browse files

Try handling new etherpad version

parent 51b7f35b
Branches
No related tags found
No related merge requests found
...@@ -153,10 +153,11 @@ def set_etherpad_text(pad, text, only_if_default=True): ...@@ -153,10 +153,11 @@ def set_etherpad_text(pad, text, only_if_default=True):
if only_if_default: if only_if_default:
current_text = get_etherpad_text(pad).strip() current_text = get_etherpad_text(pad).strip()
if (current_text != config.EMPTY_ETHERPAD.strip() if (current_text != config.EMPTY_ETHERPAD.strip()
and "<pre>Cannot GET /p" not in current_text
and len(current_text) > 0): and len(current_text) > 0):
return False return False
file_like = BytesIO(text.encode("utf-8")) file_like = BytesIO(text.encode("utf-8"))
files = {"file": file_like} files = {"file": ("content.txt", file_like, "text/plain")}
url = get_etherpad_import_url(pad) url = get_etherpad_import_url(pad)
req = requests.post(url, files=files) req = requests.post(url, files=files)
return req.status_code == 200 return req.status_code == 200
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment