mirror of
https://github.com/apache/superset.git
synced 2026-04-18 23:55:00 +00:00
fix: ignore system files on import (#12526)
This commit is contained in:
@@ -29,7 +29,7 @@ from sqlalchemy.exc import NoSuchTableError, OperationalError, SQLAlchemyError
|
||||
|
||||
from superset import event_logger
|
||||
from superset.commands.exceptions import CommandInvalidError
|
||||
from superset.commands.importers.v1.utils import remove_root
|
||||
from superset.commands.importers.v1.utils import get_contents_from_bundle
|
||||
from superset.constants import MODEL_API_RW_METHOD_PERMISSION_MAP, RouteMethod
|
||||
from superset.databases.commands.create import CreateDatabaseCommand
|
||||
from superset.databases.commands.delete import DeleteDatabaseCommand
|
||||
@@ -778,10 +778,7 @@ class DatabaseRestApi(BaseSupersetModelRestApi):
|
||||
if not upload:
|
||||
return self.response_400()
|
||||
with ZipFile(upload) as bundle:
|
||||
contents = {
|
||||
remove_root(file_name): bundle.read(file_name).decode()
|
||||
for file_name in bundle.namelist()
|
||||
}
|
||||
contents = get_contents_from_bundle(bundle)
|
||||
|
||||
passwords = (
|
||||
json.loads(request.form["passwords"])
|
||||
|
||||
Reference in New Issue
Block a user