made some minor changes in blueprints.py

This commit is contained in:
lebedevhh 2022-08-15 14:07:31 -04:00
parent 8cb6811a7b
commit 94de1326f2

View file

@ -191,8 +191,8 @@ class Blueprint(Scaffold):
import warnings import warnings
warnings.warn( warnings.warn(
"'bp.json_encoder' is deprecated and will be removed in Flask 2.3." """'bp.json_encoder' is deprecated and will be removed in Flask 2.3.
" Customize 'app.json_provider_class' or 'app.json' instead.", Customize 'app.json_provider_class' or 'app.json' instead.""",
DeprecationWarning, DeprecationWarning,
stacklevel=2, stacklevel=2,
) )
@ -203,8 +203,8 @@ class Blueprint(Scaffold):
import warnings import warnings
warnings.warn( warnings.warn(
"'bp.json_encoder' is deprecated and will be removed in Flask 2.3." """'bp.json_encoder' is deprecated and will be removed in Flask 2.3.
" Customize 'app.json_provider_class' or 'app.json' instead.", Customize 'app.json_provider_class' or 'app.json' instead.'""",
DeprecationWarning, DeprecationWarning,
stacklevel=2, stacklevel=2,
) )
@ -225,8 +225,8 @@ class Blueprint(Scaffold):
import warnings import warnings
warnings.warn( warnings.warn(
"'bp.json_decoder' is deprecated and will be removed in Flask 2.3." """'bp.json_decoder' is deprecated and will be removed in Flask 2.3.
" Customize 'app.json_provider_class' or 'app.json' instead.", Customize 'app.json_provider_class' or 'app.json' instead.""",
DeprecationWarning, DeprecationWarning,
stacklevel=2, stacklevel=2,
) )
@ -237,8 +237,8 @@ class Blueprint(Scaffold):
import warnings import warnings
warnings.warn( warnings.warn(
"'bp.json_decoder' is deprecated and will be removed in Flask 2.3." """'bp.json_decoder' is deprecated and will be removed in Flask 2.3.
" Customize 'app.json_provider_class' or 'app.json' instead.", Customize 'app.json_provider_class' or 'app.json' instead.""",
DeprecationWarning, DeprecationWarning,
stacklevel=2, stacklevel=2,
) )
@ -285,14 +285,14 @@ class Blueprint(Scaffold):
import warnings import warnings
warnings.warn( warnings.warn(
f"The setup method '{f_name}' can no longer be called on" f"""The setup method '{f_name}' can no longer be called on
f" the blueprint '{self.name}'. It has already been" the blueprint '{self.name}'. It has already been
" registered at least once, any changes will not be" registered at least once, any changes will not be
" applied consistently.\n" applied consistently.\n
"Make sure all imports, decorators, functions, etc." Make sure all imports, decorators, functions, etc.
" needed to set up the blueprint are done before" needed to set up the blueprint are done before
" registering it.\n" registering it.\n
"This warning will become an exception in Flask 2.3.", This warning will become an exception in Flask 2.3.""",
UserWarning, UserWarning,
stacklevel=3, stacklevel=3,
) )
@ -631,9 +631,9 @@ class Blueprint(Scaffold):
import warnings import warnings
warnings.warn( warnings.warn(
"'before_app_first_request' is deprecated and will be" """'before_app_first_request' is deprecated and will be
" removed in Flask 2.3. Use 'record_once' instead to run" removed in Flask 2.3. Use 'record_once' instead to run
" setup code when registering the blueprint.", setup code when registering the blueprint.""",
DeprecationWarning, DeprecationWarning,
stacklevel=2, stacklevel=2,
) )