bugGNU Health - Bugs: bug #45970, authentication does not work with...


You are not allowed to post comments on this tracker with your current authentication level.

bug #45970: authentication does not work with Flask-Login-0.3.0

Submitted by:  Emmanuel Duviviers <emmanueld>
Submitted on:  Tue 15 Sep 2015 01:28:10 PM UTC  
Category:  Upgrade Severity:  3 - Normal
Item Group:  None Status:  In Progress
Privacy:  Public Assigned to:  Chris Zimmerman <teffalump>
Open/Closed:  Closed Release:  None
Module:  fhir

Sun 03 Apr 2016 07:34:38 PM UTC, comment #5: 

Finally got around to this small fix. Sorry!


Chris Zimmerman <teffalump>
Project MemberIn charge of this item.
Wed 30 Sep 2015 02:40:24 PM UTC, comment #4: 

I just added a requirements file which specifices the 0.2.11 version.


I've done some testing, but I think there were some other side-effects of the function-to-property change that I need to explore further. I'll update the wiki with installation instructions using the requirements file and I'll continue to work on Flask-Login 0.3 support. Thanks Emmanuel!

@Cédric: That's a great idea. I'll work on that, too. And, hopefully, start separating the FHIR client/server libraries and putting them on the community server with their own pypi packages.

Chris Zimmerman <teffalump>
Project MemberIn charge of this item.
Tue 15 Sep 2015 10:32:04 PM UTC, comment #3: 

For me, requirements are for deployment not for installation.
For installation, it is better to use a setup.py (using distutils/setuptools). This will also have the benefit to allow publication on PyPI.

Cédric Krier <cedk>
Tue 15 Sep 2015 10:17:41 PM UTC, comment #2: 

I definitely should have a requirements file. I know I meant to put one in, but must've forgotten. I'll fix the usage and add a requirements file. Thanks Emmanuel and Cédric! =-)

Chris Zimmerman <teffalump>
Project MemberIn charge of this item.
Tue 15 Sep 2015 02:01:30 PM UTC, comment #1: 

I think it is better to just depend on Flask-Login>=0.3 and change the usage.
But I see that fhir/server doesn't have any proper setup.py to define such requirements, probably it will be good to create one.

Cédric Krier <cedk>
Tue 15 Sep 2015 01:28:10 PM UTC, original submission:  

I followed the set-up process to install a new instance of GNU Health with fhir server and the demo database on an up to date ubuntu 15.04 machine. Connecting through Trython works, but the Fhir module shows an error when calling the login page (which means it is unusable).

From what I have seen the error appears because Flask-Login-0.3.0 was installed (it is released recently) and not Flask-Login-0.2.x.
As mentioned (for example) in the following link : https://github.com/GovLab/noi2/issues/7 and in the documentation (https://flask-login.readthedocs.org/en/latest/#login-example) the is_authenticated is no more a function but must be called like a property, this mean that changing le line ~60 in backend/fhir/server/resources/auth.py by removing the parenthesis solves the problem, the line becomes :
    if current_user.is_authenticated:

As I'm not a python expert I think it would be a good idea to test Flask-Login version at run-time to call current_user.is_authenticated if version >= 0.3 else current_user.is_authenticated(), but I did not try this and do not know if it is possible.


Emmanuel Duviviers <emmanueld>


Attached Files
file #34891:  stack-trace.txt added by emmanueld (2KiB - text/plain - stack trace shown when running run_server.py in backend/fhir/)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by teffalump (Posted a comment)
  • -email is unavailable- added by cedk (Posted a comment)
  • -email is unavailable- added by emmanueld (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-04-03 teffalump Open/ClosedOpen => Closed
    2015-09-30 teffalump StatusNone => In Progress
        Assigned toNone => teffalump
    2015-09-15 emmanueld Attached File- => Added stack-trace.txt, #34891

    Back to the top

    Powered by Savane 3.7