Fix an issue where import/export data is not working for shared servers. #6875

This commit is contained in:
Akshay Joshi 2023-11-13 13:40:38 +05:30
parent 370cb611d7
commit 0ac471d160
2 changed files with 8 additions and 9 deletions

View File

@ -41,7 +41,8 @@ Bug fixes
| `Issue #6720 <https://github.com/pgadmin-org/pgadmin4/issues/6720>`_ - Fix an issue of the incorrect format (no indent) of SQL stored functions/procedures. | `Issue #6720 <https://github.com/pgadmin-org/pgadmin4/issues/6720>`_ - Fix an issue of the incorrect format (no indent) of SQL stored functions/procedures.
| `Issue #6769 <https://github.com/pgadmin-org/pgadmin4/issues/6769>`_ - Server config information in the about dialog should be only visible to admin users. | `Issue #6769 <https://github.com/pgadmin-org/pgadmin4/issues/6769>`_ - Server config information in the about dialog should be only visible to admin users.
| `Issue #6784 <https://github.com/pgadmin-org/pgadmin4/issues/6784>`_ - Fixed an issue where Schema Diff does not work when the user language is set to any language other than English in Preferences. | `Issue #6784 <https://github.com/pgadmin-org/pgadmin4/issues/6784>`_ - Fixed an issue where Schema Diff does not work when the user language is set to any language other than English in Preferences.
| `Issue #6817 <https://github.com/pgadmin-org/pgadmin4/issues/6817>`_ - Fixed the query generated when creating subscription where copy_data parameter was missing. | `Issue #6817 <https://github.com/pgadmin-org/pgadmin4/issues/6817>`_ - Fixed the query generated when creating subscription where copy_data parameter was missing.
| `Issue #6820 <https://github.com/pgadmin-org/pgadmin4/issues/6820>`_ - Ensure backup/restore/maintenance works with invalid pgpass file parameter. | `Issue #6820 <https://github.com/pgadmin-org/pgadmin4/issues/6820>`_ - Ensure backup/restore/maintenance works with invalid pgpass file parameter.
| `Issue #6874 <https://github.com/pgadmin-org/pgadmin4/issues/6874>`_ - Fix an issue where the browser window stuck on spinning with an Oauth user without email. | `Issue #6874 <https://github.com/pgadmin-org/pgadmin4/issues/6874>`_ - Fix an issue where the browser window stuck on spinning with an Oauth user without email.
| `Issue #6875 <https://github.com/pgadmin-org/pgadmin4/issues/6875>`_ - Fix an issue where import/export data is not working for shared servers.
| `Issue #6877 <https://github.com/pgadmin-org/pgadmin4/issues/6877>`_ - Remove the max length of 255 from password exec command in server configuration dialog. | `Issue #6877 <https://github.com/pgadmin-org/pgadmin4/issues/6877>`_ - Remove the max length of 255 from password exec command in server configuration dialog.

View File

@ -10,15 +10,14 @@
"""A blueprint module implementing the import and export functionality""" """A blueprint module implementing the import and export functionality"""
import json import json
import os
import copy import copy
from flask import url_for, Response, render_template, request, current_app
from flask import Response, render_template, request, current_app
from flask_babel import gettext as _ from flask_babel import gettext as _
from flask_security import login_required, current_user from flask_security import login_required, current_user
from pgadmin.misc.bgprocess.processes import BatchProcess, IProcessDesc from pgadmin.misc.bgprocess.processes import BatchProcess, IProcessDesc
from pgadmin.utils import PgAdminModule, get_storage_directory, html, \ from pgadmin.utils import PgAdminModule, get_storage_directory, IS_WIN, \
fs_short_path, document_dir, IS_WIN, does_utility_exist, \ does_utility_exist, get_server, filename_with_file_manager_path
filename_with_file_manager_path, get_complete_file_path
from pgadmin.utils.ajax import make_json_response, bad_request, unauthorized from pgadmin.utils.ajax import make_json_response, bad_request, unauthorized
from config import PG_DEFAULT_DRIVER from config import PG_DEFAULT_DRIVER
@ -382,9 +381,8 @@ def check_utility_exists(sid):
Returns: Returns:
None None
""" """
server = Server.query.filter_by(
id=sid, user_id=current_user.id server = get_server(sid)
).first()
if server is None: if server is None:
return make_json_response( return make_json_response(