Revert the changes done for removing support for Python 3.7

This commit is contained in:
Aditya Toshniwal
2024-06-12 16:23:27 +05:30
parent 6357672387
commit 056aff4742
8 changed files with 50 additions and 21 deletions

View File

@@ -65,7 +65,13 @@ from pgadmin.authenticate import AuthSourceManager
from pgadmin.utils.exception import CryptKeyMissing
from pgadmin.user_login_check import pga_login_required
from flask_security.views import default_render_json
try:
from flask_security.views import default_render_json
except ImportError as e:
# Support Flask-Security-Too == 3.2
if sys.version_info < (3, 8):
from flask_security.views import _render_json as default_render_json
MODULE_NAME = 'browser'
BROWSER_STATIC = 'browser.static'
@@ -1101,7 +1107,9 @@ if hasattr(config, 'SECURITY_RECOVERABLE') and config.SECURITY_RECOVERABLE:
has_error = False
form_class = _security.forms.get('reset_password_form').cls
form = form_class(request.form) if request.form else form_class()
form.user = user
if sys.version_info >= (3, 8):
form.user = user
if form.validate_on_submit():
try: