OpenNeuroLab / brainspell-neo

Working on a new version of Brainspell (an open-source platform for neuroimaging literature) to make a public JSON API that collaborators can contribute to, switch out the stack for better scalability, and provide statistical features to better conduct meta-analyses.
MIT License
15 stars 6 forks source link

Error with PMID=23313926 (is the code in heroku the last one?) #30

Closed r03ert0 closed 7 years ago

r03ert0 commented 7 years ago

Hello!

Is the heroku site running the last version of the code?

With this article:

https://brainspell.herokuapp.com/view-article?id=23313926

I get these errors in the web console:

/json/article?pmid=23313926 Failed to load resource: the server responded with a status of 500 (Internal Server Error)
view-article:350 Traceback (most recent call last):
  File "/app/.heroku/python/lib/python3.5/site-packages/tornado/web.py", line 1467, in _execute
    result = method(*self.path_args, **self.path_kwargs)
  File "json_api/brainspell.py", line 391, in get
    article = next(get_article(id))
  File "/app/.heroku/python/lib/python3.5/site-packages/peewee.py", line 2271, in next
    obj = self.iterate()
  File "/app/.heroku/python/lib/python3.5/site-packages/peewee.py", line 2253, in iterate
    raise StopIteration
StopIteration

view-article:1 Uncaught SyntaxError: Unexpected token T in JSON at position 0
    at JSON.parse (<anonymous>)
    at Object.<anonymous> (view-article:351)
    at j (jquery.js:2)
    at Object.fireWith (jquery.js:2)
    at x (jquery.js:4)
    at XMLHttpRequest.b (jquery.js:4)
Sharabesh commented 7 years ago

I'm seeing that as well. It looks like this Article PMID isn't in our database. How did you choose this Article PMID ?

r03ert0 commented 7 years ago

ah... sorry. It may be one of the articles entered manually in brainspell-arche. I was looking at 'Alzheimer' papers. If the paper is not in the DB, shouldn't the app ask if the user wants to enter it manually?

Sharabesh commented 7 years ago

image

We included the option to add PubMed ID's directly on the search page should no results be found: or on the contribute tag by directly inserting them.

I'll go ahead and change it so it redirects rather than throws an error when a user specifies a non-existant PMID.