Fix postgres test by adhering to flask specs to return none in case userid not valid
This commit is contained in:
Родитель
dec24a0121
Коммит
931c94c720
24
.travis.yml
24
.travis.yml
|
@ -18,42 +18,42 @@ env:
|
|||
matrix:
|
||||
- TOX_ENV=py27-cdh-airflow_backend_mysql
|
||||
- TOX_ENV=py27-cdh-airflow_backend_sqlite
|
||||
# - TOX_ENV=py27-cdh-airflow_backend_postgres
|
||||
- TOX_ENV=py27-cdh-airflow_backend_postgres
|
||||
- TOX_ENV=py27-hdp-airflow_backend_mysql
|
||||
- TOX_ENV=py27-hdp-airflow_backend_sqlite
|
||||
# - TOX_ENV=py27-hdp-airflow_backend_postgres
|
||||
- TOX_ENV=py27-hdp-airflow_backend_postgres
|
||||
- TOX_ENV=py34-cdh-airflow_backend_mysql
|
||||
- TOX_ENV=py34-cdh-airflow_backend_sqlite
|
||||
# - TOX_ENV=py34-cdh-airflow_backend_postgres
|
||||
- TOX_ENV=py34-cdh-airflow_backend_postgres
|
||||
- TOX_ENV=py34-hdp-airflow_backend_mysql
|
||||
- TOX_ENV=py34-hdp-airflow_backend_sqlite
|
||||
# - TOX_ENV=py34-hdp-airflow_backend_postgres
|
||||
- TOX_ENV=py34-hdp-airflow_backend_postgres
|
||||
matrix:
|
||||
exclude:
|
||||
- python: "3.4"
|
||||
env: TOX_ENV=py27-cdh-airflow_backend_mysql
|
||||
- python: "3.4"
|
||||
env: TOX_ENV=py27-cdh-airflow_backend_sqlite
|
||||
# - python: "3.4"
|
||||
# env: TOX_ENV=py27-cdh-airflow_backend_postgres
|
||||
- python: "3.4"
|
||||
env: TOX_ENV=py27-cdh-airflow_backend_postgres
|
||||
- python: "3.4"
|
||||
env: TOX_ENV=py27-hdp-airflow_backend_mysql
|
||||
- python: "3.4"
|
||||
env: TOX_ENV=py27-hdp-airflow_backend_sqlite
|
||||
# - python: "3.4"
|
||||
# env: TOX_ENV=py27-hdp-airflow_backend_postgres
|
||||
- python: "3.4"
|
||||
env: TOX_ENV=py27-hdp-airflow_backend_postgres
|
||||
- python: "2.7"
|
||||
env: TOX_ENV=py34-cdh-airflow_backend_mysql
|
||||
- python: "2.7"
|
||||
env: TOX_ENV=py34-cdh-airflow_backend_sqlite
|
||||
# - python: "2.7"
|
||||
# env: TOX_ENV=py34-cdh-airflow_backend_postgres
|
||||
- python: "2.7"
|
||||
env: TOX_ENV=py34-cdh-airflow_backend_postgres
|
||||
- python: "2.7"
|
||||
env: TOX_ENV=py34-hdp-airflow_backend_mysql
|
||||
- python: "2.7"
|
||||
env: TOX_ENV=py34-hdp-airflow_backend_sqlite
|
||||
# - python: "2.7"
|
||||
# env: TOX_ENV=py34-hdp-airflow_backend_postgres
|
||||
- python: "2.7"
|
||||
env: TOX_ENV=py34-hdp-airflow_backend_postgres
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.wheelhouse/
|
||||
|
|
|
@ -72,6 +72,9 @@ class KerberosUser(models.User):
|
|||
|
||||
@login_manager.user_loader
|
||||
def load_user(userid):
|
||||
if not userid:
|
||||
return None
|
||||
|
||||
session = settings.Session()
|
||||
user = session.query(models.User).filter(models.User.id == userid).first()
|
||||
session.expunge_all()
|
||||
|
|
|
@ -97,6 +97,9 @@ class LdapUser(models.User):
|
|||
|
||||
@login_manager.user_loader
|
||||
def load_user(userid):
|
||||
if not userid:
|
||||
return None
|
||||
|
||||
session = settings.Session()
|
||||
user = session.query(models.User).filter(models.User.id == userid).first()
|
||||
session.expunge_all()
|
||||
|
|
Загрузка…
Ссылка в новой задаче