mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-17 05:54:19 +01:00
Disable Imports on SQLite database provider (#2139)
* Disable Imports on SQLite database provider * Closes #2131
This commit is contained in:
@@ -115,6 +115,14 @@ def import_ctf(backup, erase=True):
|
||||
set_import_error(value=None, skip_print=True)
|
||||
set_import_status(value=None, skip_print=True)
|
||||
|
||||
if app.config["SQLALCHEMY_DATABASE_URI"].startswith("sqlite"):
|
||||
set_import_error(
|
||||
"Exception: Importing not currently supported for SQLite databases. See Github issue #1988."
|
||||
)
|
||||
raise Exception(
|
||||
"Importing not currently supported for SQLite databases. See Github issue #1988."
|
||||
)
|
||||
|
||||
if not zipfile.is_zipfile(backup):
|
||||
set_import_error("zipfile.BadZipfile: zipfile is invalid")
|
||||
raise zipfile.BadZipfile
|
||||
|
||||
Reference in New Issue
Block a user