forked from orbit-oss/flask
extend deprecation for renamed send_file params
This commit is contained in:
parent
48f2afbf90
commit
15a3e82823
2 changed files with 13 additions and 4 deletions
|
|
@ -20,6 +20,15 @@ Unreleased
|
|||
- The same blueprint cannot be registered with the same name. Use
|
||||
``name=`` when registering to specify a unique name.
|
||||
|
||||
- Some parameters in ``send_file`` and ``send_from_directory`` were
|
||||
renamed in 2.0. The deprecation period for the old names is extended
|
||||
to 2.2. Be sure to test with deprecation warnings visible.
|
||||
|
||||
- ``attachment_filename`` is renamed to ``download_name``.
|
||||
- ``cache_timeout`` is renamed to ``max_age``.
|
||||
- ``add_etags`` is renamed to ``etag``.
|
||||
- ``filename`` is renamed to ``path``.
|
||||
|
||||
|
||||
Version 2.0.2
|
||||
-------------
|
||||
|
|
|
|||
|
|
@ -452,7 +452,7 @@ def _prepare_send_file_kwargs(
|
|||
warnings.warn(
|
||||
"The 'attachment_filename' parameter has been renamed to"
|
||||
" 'download_name'. The old name will be removed in Flask"
|
||||
" 2.1.",
|
||||
" 2.2.",
|
||||
DeprecationWarning,
|
||||
stacklevel=3,
|
||||
)
|
||||
|
|
@ -461,7 +461,7 @@ def _prepare_send_file_kwargs(
|
|||
if cache_timeout is not None:
|
||||
warnings.warn(
|
||||
"The 'cache_timeout' parameter has been renamed to"
|
||||
" 'max_age'. The old name will be removed in Flask 2.1.",
|
||||
" 'max_age'. The old name will be removed in Flask 2.2.",
|
||||
DeprecationWarning,
|
||||
stacklevel=3,
|
||||
)
|
||||
|
|
@ -470,7 +470,7 @@ def _prepare_send_file_kwargs(
|
|||
if add_etags is not None:
|
||||
warnings.warn(
|
||||
"The 'add_etags' parameter has been renamed to 'etag'. The"
|
||||
" old name will be removed in Flask 2.1.",
|
||||
" old name will be removed in Flask 2.2.",
|
||||
DeprecationWarning,
|
||||
stacklevel=3,
|
||||
)
|
||||
|
|
@ -666,7 +666,7 @@ def send_from_directory(
|
|||
if filename is not None:
|
||||
warnings.warn(
|
||||
"The 'filename' parameter has been renamed to 'path'. The"
|
||||
" old name will be removed in Flask 2.1.",
|
||||
" old name will be removed in Flask 2.2.",
|
||||
DeprecationWarning,
|
||||
stacklevel=2,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue