Fix some deprecation warnings with newer flask version

This commit is contained in:
Chase Sterling 2016-07-14 17:59:08 -04:00
parent a22e99bf9b
commit 36d3fb7215
12 changed files with 15 additions and 14 deletions

View file

@ -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

View file

@ -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]])

View file

@ -139,6 +139,7 @@ class Config(object):
DEBUG = False
ASSETS_DEBUG = False
SQLALCHEMY_ECHO = False
SQLALCHEMY_TRACK_MODIFICATIONS = False
MODULES = ['wiki', 'search', 'auth']

View file

@ -1,4 +1,4 @@
from flask.ext.sqlalchemy import DeclarativeMeta
from flask_sqlalchemy import DeclarativeMeta
from functools import wraps

View file

@ -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

View file

@ -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()

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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__)

View file

@ -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)

View file

@ -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