Fix some deprecation warnings with newer flask version
This commit is contained in:
parent
a22e99bf9b
commit
36d3fb7215
|
@ -13,10 +13,10 @@ import httplib
|
||||||
import traceback
|
import traceback
|
||||||
import click
|
import click
|
||||||
from flask import Flask, request, render_template, url_for, redirect, g
|
from flask import Flask, request, render_template, url_for, redirect, g
|
||||||
from flask.ext.cache import Cache
|
from flask_cache import Cache
|
||||||
from flask.ext.login import LoginManager, current_user
|
from flask_login import LoginManager, current_user
|
||||||
from flask.ext.sqlalchemy import SQLAlchemy
|
from flask_sqlalchemy import SQLAlchemy
|
||||||
from flask.ext.assets import Environment, Bundle
|
from flask_assets import Environment, Bundle
|
||||||
from flask_ldap_login import LDAPLoginManager
|
from flask_ldap_login import LDAPLoginManager
|
||||||
from functools import update_wrapper
|
from functools import update_wrapper
|
||||||
from werkzeug.routing import BaseConverter
|
from werkzeug.routing import BaseConverter
|
||||||
|
|
|
@ -425,7 +425,7 @@ def clear_cache():
|
||||||
def test():
|
def test():
|
||||||
""" Run tests
|
""" Run tests
|
||||||
"""
|
"""
|
||||||
for mod in [('flask.ext.testing', 'Flask-Testing'), ('nose', 'nose'), ('blinker', 'blinker')]:
|
for mod in [('flask_testing', 'Flask-Testing'), ('nose', 'nose'), ('blinker', 'blinker')]:
|
||||||
if not module_exists(mod[0]):
|
if not module_exists(mod[0]):
|
||||||
pip.main(['install', mod[1]])
|
pip.main(['install', mod[1]])
|
||||||
|
|
||||||
|
|
|
@ -139,6 +139,7 @@ class Config(object):
|
||||||
DEBUG = False
|
DEBUG = False
|
||||||
ASSETS_DEBUG = False
|
ASSETS_DEBUG = False
|
||||||
SQLALCHEMY_ECHO = False
|
SQLALCHEMY_ECHO = False
|
||||||
|
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
||||||
|
|
||||||
MODULES = ['wiki', 'search', 'auth']
|
MODULES = ['wiki', 'search', 'auth']
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from flask.ext.sqlalchemy import DeclarativeMeta
|
from flask_sqlalchemy import DeclarativeMeta
|
||||||
|
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import tempfile
|
import tempfile
|
||||||
from flask.ext.testing import TestCase
|
from flask_testing import TestCase
|
||||||
from realms.lib.util import random_string
|
from realms.lib.util import random_string
|
||||||
from realms import create_app
|
from realms import create_app
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
from realms import login_manager
|
from realms import login_manager
|
||||||
from flask import request, flash, redirect
|
from flask import request, flash, redirect
|
||||||
from flask.ext.login import login_url
|
from flask_login import login_url
|
||||||
|
|
||||||
modules = set()
|
modules = set()
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
from flask import render_template
|
from flask import render_template
|
||||||
from flask.ext.login import login_user
|
from flask_login import login_user
|
||||||
from realms import ldap
|
from realms import ldap
|
||||||
from flask_ldap_login import LDAPLoginForm
|
from flask_ldap_login import LDAPLoginForm
|
||||||
from ..models import BaseUser
|
from ..models import BaseUser
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
from flask import current_app, render_template
|
from flask import current_app, render_template
|
||||||
from flask.ext.login import logout_user, login_user
|
from flask_login import logout_user, login_user
|
||||||
from realms import login_manager, db
|
from realms import login_manager, db
|
||||||
from realms.lib.model import Model
|
from realms.lib.model import Model
|
||||||
from ..models import BaseUser
|
from ..models import BaseUser
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
from flask import current_app
|
from flask import current_app
|
||||||
from flask.ext.login import UserMixin, logout_user, AnonymousUserMixin
|
from flask_login import UserMixin, logout_user, AnonymousUserMixin
|
||||||
from realms import login_manager
|
from realms import login_manager
|
||||||
from realms.lib.util import gravatar_url
|
from realms.lib.util import gravatar_url
|
||||||
from itsdangerous import URLSafeSerializer, BadSignature
|
from itsdangerous import URLSafeSerializer, BadSignature
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
from flask import current_app, render_template, request, redirect, Blueprint, flash, url_for
|
from flask import current_app, render_template, request, redirect, Blueprint, flash, url_for
|
||||||
from flask.ext.login import logout_user
|
from flask_login import logout_user
|
||||||
from realms.modules.auth.models import Auth
|
from realms.modules.auth.models import Auth
|
||||||
|
|
||||||
blueprint = Blueprint('auth', __name__)
|
blueprint = Blueprint('auth', __name__)
|
||||||
|
|
|
@ -14,7 +14,7 @@ def whoosh(app):
|
||||||
|
|
||||||
|
|
||||||
def elasticsearch(app):
|
def elasticsearch(app):
|
||||||
from flask.ext.elastic import Elastic
|
from flask_elastic import Elastic
|
||||||
fields = app.config.get('ELASTICSEARCH_FIELDS')
|
fields = app.config.get('ELASTICSEARCH_FIELDS')
|
||||||
return ElasticSearch(Elastic(app), fields)
|
return ElasticSearch(Elastic(app), fields)
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ import itertools
|
||||||
import sys
|
import sys
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
|
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
|
||||||
from flask.ext.login import login_required, current_user
|
from flask_login import login_required, current_user
|
||||||
from realms.lib.util import to_canonical, remove_ext, gravatar_url
|
from realms.lib.util import to_canonical, remove_ext, gravatar_url
|
||||||
from .models import PageNotFound
|
from .models import PageNotFound
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue