Skip to content

Commit

Permalink
fix nanopub generate btn
Browse files Browse the repository at this point in the history
  • Loading branch information
vemonet committed Nov 1, 2023
1 parent 04922de commit 5c05596
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions backend/app/api/nanopub.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ async def publish_assertion(
) -> Response:
nanopub_rdf = jsonable_encoder(nanopub_rdf)

print(current_user)
if not current_user or "id" not in current_user.keys():
raise HTTPException(
status_code=403,
Expand All @@ -117,9 +116,11 @@ async def publish_assertion(
# nanopub_rdf = jsonld.expand(nanopub_rdf)
# nanopub_rdf = json.dumps(nanopub_rdf, ensure_ascii=False).encode("utf-8")

annotations_rdf = nanopub_rdf["@provenance"]
annotations_rdf = None
if "@provenance" in nanopub_rdf:
annotations_rdf = nanopub_rdf["@provenance"]
del nanopub_rdf["@provenance"]

del nanopub_rdf["@provenance"]
nanopub_rdf = json.dumps(nanopub_rdf)

g = Graph()
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/PublishNanopubButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const PublishNanopubButtons = ({
requestParams['source'] = inputSource
}
const access_token = user['access_token']
console.log(user)
// console.log(user)
axios
.post(`${$userSettings.api}/assertion`, stmtJsonld, {
headers: {Authorization: `Bearer ${access_token}`},
Expand Down

0 comments on commit 5c05596

Please sign in to comment.