Conditionally pin Flask version based on Python version.

This commit is contained in:
Akshay Joshi
2022-08-17 12:21:05 +05:30
parent d4fdd4601e
commit f771d3a4bb
4 changed files with 11 additions and 10 deletions

View File

@@ -931,7 +931,7 @@ if hasattr(config, 'SECURITY_CHANGEABLE') and config.SECURITY_CHANGEABLE:
has_error = False
form_class = _security.change_password_form
req_json = request.get_json(force=True)
req_json = request.get_json(silent=True)
if req_json:
form = form_class(MultiDict(req_json))
@@ -966,7 +966,7 @@ if hasattr(config, 'SECURITY_CHANGEABLE') and config.SECURITY_CHANGEABLE:
)
has_error = True
if request.get_json(force=True) is None and not has_error:
if request.get_json(silent=True) is None and not has_error:
after_this_request(view_commit)
do_flash(*get_message('PASSWORD_CHANGE'))
@@ -981,7 +981,7 @@ if hasattr(config, 'SECURITY_CHANGEABLE') and config.SECURITY_CHANGEABLE:
return redirect(get_url(_security.post_change_view) or
get_url(_security.post_login_view))
if request.get_json(force=True) and not has_error:
if request.get_json(silent=True) and not has_error:
form.user = current_user
return default_render_json(form)
@@ -1018,7 +1018,7 @@ if hasattr(config, 'SECURITY_RECOVERABLE') and config.SECURITY_RECOVERABLE:
"""View function that handles a forgotten password request."""
has_error = False
form_class = _security.forgot_password_form
req_json = request.get_json(force=True)
req_json = request.get_json(silent=True)
if req_json:
form = form_class(MultiDict(req_json))
@@ -1068,11 +1068,11 @@ if hasattr(config, 'SECURITY_RECOVERABLE') and config.SECURITY_RECOVERABLE:
'danger')
has_error = True
if request.get_json(force=True) is None and not has_error:
if request.get_json(silent=True) is None and not has_error:
do_flash(*get_message('PASSWORD_RESET_REQUEST',
email=form.user.email))
if request.get_json(force=True) and not has_error:
if request.get_json(silent=True) and not has_error:
return default_render_json(form, include_user=False)
return _security.render_template(