Skip to content

Commit

Permalink
global: flask-security 1.7.5 fix
Browse files Browse the repository at this point in the history
Signed-off-by: Lars Holm Nielsen <lars.holm.nielsen@cern.ch>
  • Loading branch information
lnielsen committed Dec 3, 2015
1 parent 29506f8 commit f51a257
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion invenio_i18n/selectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def get_locale():

# In the case of the registered user has a prefered language.
if hasattr(current_app, 'login_manager') and \
current_user.is_authenticated():
current_user.is_authenticated:
language_user_key = current_app.config['I18N_USER_LANG_ATTR']
if getattr(current_user, language_user_key, None) in locales:
return getattr(current_user, language_user_key)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
'pytest-cov>=1.8.0',
'pytest-pep8>=1.0.6',
'pytest>=2.8.0',
'Flask-Login<0.3.0,>=0.2.11',
'Flask-Login>=0.3.0',
]

extras_require = {
Expand Down
10 changes: 2 additions & 8 deletions tests/test_invenio_i18n_selectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,14 @@ class FakeUser(object):

def __init__(self, prefered_language):
"""Initialize fake user."""
self.is_active = True
self.is_authenticated = True
self.prefered_language = prefered_language

def is_active(self):
"""True, fake user is active."""
return True

def get_id(self):
"""Return a default ID. This is only a fake object."""
return 1

def is_authenticated(self):
"""True, fake user is authenticated."""
return True


def test_get_locale_querystring(app):
"""Test getting locales from the querystring."""
Expand Down

0 comments on commit f51a257

Please sign in to comment.