[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Health-dev] Error while accessing Patient Database
From: |
Chris |
Subject: |
Re: [Health-dev] Error while accessing Patient Database |
Date: |
Fri, 8 May 2015 18:06:41 -0700 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
Hiya Vishal!
Let me see...
> I am encountering following error on FHIR server while accessing by making
> following request http://localhost:5000/Patient
Are you authenticated when you view this endpoint? That is, have you
logged in at http://localhost:5000/auth/login?
Here, I think, are the interesting parts:
> File "/home/gnuhealth/FHIR/backend/fhir/server/resources/auth.py", line
> 50, in __init__
> ident = get_user_id(uid, username, password)
> File
> "/home/gnuhealth/Venvironment/venv/local/lib/python2.7/site-packages/flask_tryton.py",
> line 128, in wrapper
> for n, v in kwargs.iteritems()))
> File "/home/gnuhealth/FHIR/backend/fhir/server/resources/auth.py", line
> 34, in get_user_id
> user=user_model.search([('id', '=', uid)])
> File
> "/home/gnuhealth/gnuhealth/tryton/server/trytond-3.4.3/trytond/model/modelsql.py",
> line 1038, in search
> cursor.execute(*select)
> File
> "/home/gnuhealth/gnuhealth/tryton/server/trytond-3.4.3/trytond/backend/postgresql/database.py",
> line 312, in execute
> return self.cursor.execute(sql, params)
> DataError: invalid input syntax for integer: "None"
> LINE 1: ...estamp" FROM "res_user" AS "a" WHERE (("a"."id" = 'None') AN...
This is odd because the id is None, but it passes the check. Here is
the code:
if uid is not None:
user=user_model.search([('id', '=', uid)])
Seems something is converting None to string/unicode. Probably it's
allowing AnonymousUser logins. I cannot seem to replicate this bug...
the decorator should not allow that. Is your Flask-Login up-to-date?
What's your config looking like? What version code you running? Is every
endpoint affected (/Observation, /Condition, etc)?
Thanks!
-C