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 click
|
||||
from flask import Flask, request, render_template, url_for, redirect, g
|
||||
from flask.ext.cache import Cache
|
||||
from flask.ext.login import LoginManager, current_user
|
||||
from flask.ext.sqlalchemy import SQLAlchemy
|
||||
from flask.ext.assets import Environment, Bundle
|
||||
from flask_cache import Cache
|
||||
from flask_login import LoginManager, current_user
|
||||
from flask_sqlalchemy import SQLAlchemy
|
||||
from flask_assets import Environment, Bundle
|
||||
from flask_ldap_login import LDAPLoginManager
|
||||
from functools import update_wrapper
|
||||
from werkzeug.routing import BaseConverter
|
||||
|
|
|
@ -425,7 +425,7 @@ def clear_cache():
|
|||
def test():
|
||||
""" 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]):
|
||||
pip.main(['install', mod[1]])
|
||||
|
||||
|
|
|
@ -139,6 +139,7 @@ class Config(object):
|
|||
DEBUG = False
|
||||
ASSETS_DEBUG = False
|
||||
SQLALCHEMY_ECHO = False
|
||||
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
||||
|
||||
MODULES = ['wiki', 'search', 'auth']
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from flask.ext.sqlalchemy import DeclarativeMeta
|
||||
from flask_sqlalchemy import DeclarativeMeta
|
||||
|
||||
from functools import wraps
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import os
|
||||
import shutil
|
||||
import tempfile
|
||||
from flask.ext.testing import TestCase
|
||||
from flask_testing import TestCase
|
||||
from realms.lib.util import random_string
|
||||
from realms import create_app
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from realms import login_manager
|
||||
from flask import request, flash, redirect
|
||||
from flask.ext.login import login_url
|
||||
from flask_login import login_url
|
||||
|
||||
modules = set()
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from flask import render_template
|
||||
from flask.ext.login import login_user
|
||||
from flask_login import login_user
|
||||
from realms import ldap
|
||||
from flask_ldap_login import LDAPLoginForm
|
||||
from ..models import BaseUser
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
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.lib.model import Model
|
||||
from ..models import BaseUser
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
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.lib.util import gravatar_url
|
||||
from itsdangerous import URLSafeSerializer, BadSignature
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
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
|
||||
|
||||
blueprint = Blueprint('auth', __name__)
|
||||
|
|
|
@ -14,7 +14,7 @@ def whoosh(app):
|
|||
|
||||
|
||||
def elasticsearch(app):
|
||||
from flask.ext.elastic import Elastic
|
||||
from flask_elastic import Elastic
|
||||
fields = app.config.get('ELASTICSEARCH_FIELDS')
|
||||
return ElasticSearch(Elastic(app), fields)
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ import itertools
|
|||
import sys
|
||||
from datetime import datetime
|
||||
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 .models import PageNotFound
|
||||
|
||||
|
|
Loading…
Reference in a new issue