Skip to content

Commit 66d7d96

Browse files
committed
Handle editing of drafts
1 parent 571c7a8 commit 66d7d96

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

caltechdata_api/caltechdata_edit.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,14 @@ def caltechdata_edit(
106106
verify=verify,
107107
)
108108
if result.status_code != 200:
109-
print(result.text)
110-
exit()
109+
result = requests.get(
110+
url + "/api/records/" + idv + "/draft",
111+
headers=headers,
112+
verify=verify,
113+
)
114+
if result.status_code != 200:
115+
print(result.text)
116+
exit()
111117
# We want files to stay the same as the existing record
112118
data["files"] = result.json()["files"]
113119
print(url + "/api/records/" + idv + "/draft")

0 commit comments

Comments
 (0)