mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Conditionally pin Flask version based on Python version.
This commit is contained in:
parent
d4fdd4601e
commit
f771d3a4bb
@ -8,7 +8,8 @@
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
Flask==2.1.*
|
||||
Flask==2.0.3; python_version <= '3.6'
|
||||
Flask==2.1.*; python_version >= '3.7'
|
||||
Flask-Gravatar==0.*
|
||||
Flask-Login==0.*
|
||||
Flask-Mail==0.*
|
||||
|
@ -178,7 +178,7 @@ class KerberosAuthentication(BaseAuthentication):
|
||||
headers = Headers()
|
||||
authorization = request.headers.get("Authorization", None)
|
||||
form_class = _security.login_form
|
||||
req_json = request.get_json(force=True)
|
||||
req_json = request.get_json(silent=True)
|
||||
|
||||
if req_json:
|
||||
form = form_class(MultiDict(req_json))
|
||||
|
@ -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(
|
||||
|
@ -1896,7 +1896,7 @@ def start_query_download_tool(trans_id):
|
||||
errormsg=TRANSACTION_STATUS_CHECK_FAILED
|
||||
)
|
||||
|
||||
data = request.values if request.values else request.get_json(force=True)
|
||||
data = request.values if request.values else request.get_json(silent=True)
|
||||
if data is None:
|
||||
return make_json_response(
|
||||
status=410,
|
||||
@ -2435,7 +2435,7 @@ def clear_query_history(trans_id):
|
||||
status, error_msg, conn, trans_obj, session_ob = \
|
||||
check_transaction_status(trans_id)
|
||||
|
||||
filter = request.get_json(force=True)
|
||||
filter = request.get_json(silent=True)
|
||||
return QueryHistory.clear(current_user.id, trans_obj.sid, conn.db, filter)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user