aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2021-07-27 18:57:09 -0700
committerBryan Newbold <bnewbold@robocracy.org>2021-07-27 18:57:09 -0700
commitf3481c02bd7a50d9073902dba07fe265eecb93db (patch)
tree1865a469f1713ef6e3d18d45f736c515f0b542ee /python
parentfa2ba60834cf3cb3edea05af3c1830e6fc0d5bcc (diff)
downloadfatcat-f3481c02bd7a50d9073902dba07fe265eecb93db.tar.gz
fatcat-f3481c02bd7a50d9073902dba07fe265eecb93db.zip
refs: lint fixes
Diffstat (limited to 'python')
-rw-r--r--python/fatcat_tools/references.py1
-rw-r--r--python/fatcat_web/ref_routes.py4
2 files changed, 3 insertions, 2 deletions
diff --git a/python/fatcat_tools/references.py b/python/fatcat_tools/references.py
index 508cf19d..496a46e1 100644
--- a/python/fatcat_tools/references.py
+++ b/python/fatcat_tools/references.py
@@ -99,6 +99,7 @@ class EnrichedBiblioRef(BaseModel):
access: List[AccessOption]
@validator('release')
+ @classmethod
def check_release(cls, v):
if v is not None and not isinstance(v, ReleaseEntity):
raise ValueError("expected a ReleaseEntity")
diff --git a/python/fatcat_web/ref_routes.py b/python/fatcat_web/ref_routes.py
index 88ac0744..d4219012 100644
--- a/python/fatcat_web/ref_routes.py
+++ b/python/fatcat_web/ref_routes.py
@@ -3,7 +3,7 @@ Flask endpoints for reference (citation) endpoints. Eg, listing references
"inbound" and "outbound" from a specific release or work.
"""
-from flask import render_template, request, jsonify, Response
+from flask import render_template, request, Response
from fatcat_openapi_client import *
from fuzzycat.grobid_unstructured import grobid_api_process_citation, transform_grobid_ref_xml, grobid_ref_to_release
from fuzzycat.simple import close_fuzzy_biblio_matches, close_fuzzy_release_matches
@@ -154,7 +154,7 @@ def release_view_refs_inbound_json(ident):
@app.route('/openlibrary/OL<int:id_num>W/refs-in.json', methods=['GET', 'OPTIONS'])
@crossdomain(origin='*',headers=['access-control-allow-origin','Content-Type'])
-def openlibrary_view_refs_inbound_json(ident):
+def openlibrary_view_refs_inbound_json(id_num):
openlibrary_id = f"OL{id_num}W"
hits = _refs_web("in", openlibrary_id=openlibrary_id)
return Response(hits.json(exclude_unset=True), mimetype="application/json")