Commit ddb31402 authored by Ondřej Borýsek's avatar Ondřej Borýsek
Browse files

Fix Scan2Report alternative folder setup

parent a2e6acf2
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -25,10 +25,10 @@ def create_app(skip_pwndoc: bool = False):
    logger.add("user_data/importer-logs/main.log", rotation="1 week", retention="60 days", compression="gz", encoding="utf8")
    logger.add("user_data/importer-logs/main.log", rotation="1 week", retention="60 days", compression="gz", encoding="utf8")
    Path(relative_path('api_examples/')).mkdir(parents=True, exist_ok=True)
    Path(relative_path('api_examples/')).mkdir(parents=True, exist_ok=True)


    pwndoc_db_init.PwnDocUpdate.setup_scan2report_plugin_folder()
    if not skip_pwndoc:
    if not skip_pwndoc:
        pwndoc_db_init.InitialData()
        pwndoc_db_init.InitialData()
        pwndoc_db_init.PwnDocUpdate.add_new_fields_if_needed()
        pwndoc_db_init.PwnDocUpdate.add_new_fields_if_needed()
        pwndoc_db_init.PwnDocUpdate.setup_scan2report_plugin_folder()


    app = Flask(__name__, static_url_path=f"{config.IMPORTER_URL_PREFIX}/static")
    app = Flask(__name__, static_url_path=f"{config.IMPORTER_URL_PREFIX}/static")


+1 −0
Original line number Original line Diff line number Diff line
@@ -196,6 +196,7 @@ class PwnDocUpdate:


    @staticmethod
    @staticmethod
    def setup_scan2report_plugin_folder():
    def setup_scan2report_plugin_folder():
        # todo: this is Scan2Report only, move it outside of PwnDocUpdate class
        if Path(config.TEMPLATE_FOLDER_SCAN2REPORT).exists():
        if Path(config.TEMPLATE_FOLDER_SCAN2REPORT).exists():
            return
            return
        # Path(config.TEMPLATE_FOLDER_SCAN2REPORT).mkdir(parents=True, exist_ok=False)
        # Path(config.TEMPLATE_FOLDER_SCAN2REPORT).mkdir(parents=True, exist_ok=False)