Skip to content

Commit 7bd6503

Browse files
committed
Fix community submission and prep for release
1 parent 299c0df commit 7bd6503

File tree

6 files changed

+26
-33
lines changed

6 files changed

+26
-33
lines changed

caltechdata_api/caltechdata_write.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,15 @@ def send_to_community(review_link, data, headers, publish, community, message=No
113113
result = requests.put(review_link, json=data, headers=headers)
114114
if result.status_code != 200:
115115
raise Exception(result.text)
116-
submit_link = result.json()["links"]["actions"]["submit"]
116+
submit_link = review_link.replace('/review','/actions/submit-review')
117117
data = comment = {
118118
"payload": {
119119
"content": message,
120120
"format": "html",
121121
}
122122
}
123123
result = requests.post(submit_link, json=data, headers=headers)
124-
if result.status_code != 200:
124+
if result.status_code != 202:
125125
raise Exception(result.text)
126126
if publish:
127127
accept_link = result.json()["links"]["actions"]["accept"]

codemeta.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"codeRepository": "https://github.com/caltechlibrary/caltechdata_api",
77
"issueTracker": "https://github.com/caltechlibrary/caltechdata_api/issues",
88
"license": "https://data.caltech.edu/license",
9-
"version": "1.4.1",
9+
"version": "1.4.2",
1010
"author": [
1111
{
1212
"@type": "Person",
@@ -21,7 +21,7 @@
2121
}],
2222
"developmentStatus": "active",
2323
"downloadUrl":
24-
"https://github.com/caltechlibrary/caltechdata_api/archive/1.4.1.zip",
24+
"https://github.com/caltechlibrary/caltechdata_api/archive/1.4.2.zip",
2525
"keywords": [
2626
"GitHub",
2727
"metadata",

process_tomograms.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -432,21 +432,21 @@ def process_record(source, edit=None):
432432
if idv not in record_ids:
433433
print(f)
434434
with open(f, "r") as infile:
435-
try:
436-
source = json.load(infile)
437-
except json.decoder.JSONDecodeError:
438-
print("ERROR")
439-
error_ids.append(idv)
440-
with open("tomogram_error_ids.json", "w") as outfile:
441-
json.dump({"ids": error_ids}, outfile)
442-
os.rename(f, "errors/" + f)
443-
source = None
444-
except UnicodeDecodeError:
445-
print("ERROR")
446-
error_ids.append(idv)
447-
with open("tomogram_error_ids.json", "w") as outfile:
448-
json.dump({"ids": error_ids}, outfile)
449-
os.rename(f, "errors/" + f)
450-
source = None
451-
if source:
452-
process_record(source)
435+
try:
436+
source = json.load(infile)
437+
except json.decoder.JSONDecodeError:
438+
print("ERROR")
439+
error_ids.append(idv)
440+
with open("tomogram_error_ids.json", "w") as outfile:
441+
json.dump({"ids": error_ids}, outfile)
442+
os.rename(f, "errors/" + f)
443+
source = None
444+
except UnicodeDecodeError:
445+
print("ERROR")
446+
error_ids.append(idv)
447+
with open("tomogram_error_ids.json", "w") as outfile:
448+
json.dump({"ids": error_ids}, outfile)
449+
os.rename(f, "errors/" + f)
450+
source = None
451+
if source:
452+
process_record(source)

rdm.json

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,6 @@
9191
]
9292
}
9393
]
94-
},
95-
"references": [
96-
{
97-
"reference": "Nielsen et al,..",
98-
"identifier": "0000 0001 1456 7559",
99-
"scheme": "isni"
100-
}
101-
]
94+
}
10295
}
10396
}

tomogram_ids.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

write_authors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
metadata = json.load(metaf)
2121

2222
production = False
23-
publish = True
23+
publish = False
2424
authors = True
25-
community = "70768bd5-918b-441b-bd45-12a3f296447c"
25+
community = "669e5e57-7d9e-4d19-8ab5-9c6158562fb3"
2626

2727
response = caltechdata_write(
2828
metadata,

0 commit comments

Comments
 (0)