summaryrefslogtreecommitdiffstats
path: root/python/fatcat_web/routes.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-12-13 17:43:27 -0800
committerBryan Newbold <bnewbold@robocracy.org>2019-12-13 18:07:53 -0800
commit9c1fd7cb8e60c397fa6defef2f0dc1eacc8d8aa7 (patch)
treec6d3f80610af009ebba799951bfe3a5c56e72694 /python/fatcat_web/routes.py
parent4b2fc499ac77f4b929943b54a4c28b78659468e8 (diff)
downloadfatcat-9c1fd7cb8e60c397fa6defef2f0dc1eacc8d8aa7.tar.gz
fatcat-9c1fd7cb8e60c397fa6defef2f0dc1eacc8d8aa7.zip
update ingest request schema
This is mostly changing ingest_type from 'file' to 'pdf', and adding 'link_source'/'link_source_id', plus some small cleanups.
Diffstat (limited to 'python/fatcat_web/routes.py')
-rw-r--r--python/fatcat_web/routes.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/python/fatcat_web/routes.py b/python/fatcat_web/routes.py
index cc0af5cc..8583d255 100644
--- a/python/fatcat_web/routes.py
+++ b/python/fatcat_web/routes.py
@@ -648,11 +648,11 @@ def release_save(ident):
if form.is_submitted():
if form.validate_on_submit():
# got a valid spn request! try to send to kafka-pixy
- msg = form.to_ingest_request(release)
+ msg = form.to_ingest_request(release, ingest_request_source="savepapernow-web")
try:
kafka_pixy_produce(
Config.KAFKA_SAVEPAPERNOW_TOPIC,
- json.dumps(msg),
+ json.dumps(msg, sort_keys=True),
)
except Exception as e:
print(e, file=sys.stderr)
@@ -666,6 +666,10 @@ def release_save(ident):
form.release_stage.data = release.release_stage
if release.ext_ids.doi:
form.base_url.data = "https://doi.org/{}".format(release.ext_ids.doi)
+ elif release.ext_ids.arxiv:
+ form.base_url.data = "https://arxiv.org/pdf/{}.pdf".format(release.ext_ids.arxiv)
+ elif release.ext_ids.pmcid:
+ form.base_url.data = "http://europepmc.org/backend/ptpmcrender.fcgi?accid={}&blobtype=pdf".format(release.ext_ids.pmcid)
return render_template('release_save.html', entity=release, form=form), 200
### Search ##################################################################