Commit e0a61cd6 authored by Benjamin "Ziirish" SANS's avatar Benjamin "Ziirish" SANS

switch to flask-restx instead of flask-restplus which is no longer maintained

parent 08e60b7c
Pipeline #1747 failed with stages
in 22 minutes and 33 seconds
......@@ -14,7 +14,7 @@ import uuid
import hashlib
from flask import Blueprint, Response, request, current_app, session, abort, g
from flask_restplus import Api as ApiPlus
from flask_restx import Api as ApiPlus
from flask_login import current_user
from importlib import import_module
from functools import wraps
......@@ -95,7 +95,7 @@ def check_acl(func):
class Api(ApiPlus):
"""Wrapper class around :class:`flask_restplus.Api`"""
"""Wrapper class around :class:`flask_restx.Api`"""
logger = logger
# TODO: should use global object instead of reference
loaded = False
......
......@@ -17,8 +17,8 @@ from ..decorators import browser_cache
from ..ext.cache import cache
from ..exceptions import BUIserverException
from flask_restplus.marshalling import marshal
from flask_restplus import inputs
from flask_restx.marshalling import marshal
from flask_restx import inputs
from flask import current_app, request
from flask_login import current_user
......
......@@ -8,10 +8,10 @@
"""
import flask_restplus.fields
import flask_restx.fields
from flask_restplus.fields import * # noqa # pylint: disable=locally-disabled, wildcard-import, unused-wildcard-import
from flask_restx.fields import * # noqa # pylint: disable=locally-disabled, wildcard-import, unused-wildcard-import
from .my_fields import DateTime, DateTimeHuman, BackupNumber, SafeString, LocalizedString # noqa
__all__ = flask_restplus.fields.__all__ + \
__all__ = flask_restx.fields.__all__ + \
(DateTime, DateTimeHuman, BackupNumber, SafeString, LocalizedString)
......@@ -13,7 +13,7 @@ import arrow
from ...ext.i18n import get_locale
from flask_restplus import fields
from flask_restx import fields
from flask_babel import gettext as _
from flask import escape
from tzlocal import get_localzone
......
......@@ -10,8 +10,8 @@
import inspect
import json
from flask_restplus import Resource as ResourcePlus
from flask_restplus.errors import abort
from flask_restx import Resource as ResourcePlus
from flask_restx.errors import abort
from ...tools.logging import logger
......@@ -28,7 +28,7 @@ class Resource(ResourcePlus):
"""
Properly abort the current request
See: :func:`~flask_restplus.errors.abort`
See: :func:`~flask_restx.errors.abort`
"""
if message and not isinstance(message, str):
try:
......
......@@ -20,7 +20,7 @@ from time import gmtime, strftime, time
from flask import Response, send_file, make_response, after_this_request, \
current_app
from flask_login import current_user
from flask_restplus import inputs
from flask_restx import inputs
from werkzeug.datastructures import Headers
from werkzeug.exceptions import HTTPException
......
......@@ -19,7 +19,7 @@ from ..utils import NOTIF_INFO
from flask_babel import gettext as _, refresh
from flask import jsonify, request, url_for, current_app, g, session, render_template_string
from flask_login import current_user
from flask_restplus import inputs
from flask_restx import inputs
from jinja2 import Environment, meta
from ..datastructures import ImmutableMultiDict, MultiDict
......
......@@ -27,7 +27,7 @@ from zlib import adler32
from flask import url_for, Response, current_app, after_this_request, \
send_file, request, g, session
from flask_babel import gettext as _
from flask_restplus import inputs
from flask_restx import inputs
from flask_login import current_user
from datetime import timedelta
from werkzeug.datastructures import Headers
......
......@@ -31,7 +31,7 @@ def browser_cache(expires=None):
"""
from wsgiref.handlers import format_date_time
from flask import g
from flask_restplus.utils import unpack
from flask_restx.utils import unpack
def cache_decorator(view):
@wraps(view)
......
......@@ -4,7 +4,7 @@ Flask-Login==0.4.1
Flask-Bower==1.3.0
Flask-Babel==0.12.2
Flask-WTF==0.14.2
flask-restplus==0.13.0
flask-restx==0.1.1
Flask-Caching==1.8.0
Flask-Session==0.3.1
WTForms==2.2.1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment