Merge branch 'dev' into 'master'

Fix version 3 importing and typos

See merge request crafty-controller/crafty-4!300
This commit is contained in:
Iain Powrie 2022-06-05 20:19:53 +00:00
commit 9be5fc0d09
3 changed files with 13 additions and 5 deletions

View File

@ -16,12 +16,15 @@ logger = logging.getLogger(__name__)
class MainPrompt(cmd.Cmd):
def __init__(self, helper, tasks_manager, migration_manager, main_controller):
def __init__(
self, helper, tasks_manager, migration_manager, main_controller, import3
):
super().__init__()
self.helper: Helpers = helper
self.tasks_manager: TasksManager = tasks_manager
self.migration_manager: MigrationManager = migration_manager
self.controller: Controller = main_controller
self.import3: Import3 = import3
# overrides the default Prompt
self.prompt = f"Crafty Controller v{self.helper.get_version_string()} > "
@ -101,7 +104,7 @@ class MainPrompt(cmd.Cmd):
self.stdout.flush()
def do_import3(self, _line):
Import3.start_import()
self.import3.start_import()
def universal_exit(self):
logger.info("Stopping all server daemons / threads")

View File

@ -182,7 +182,7 @@ class PublicHandler(BaseHandler):
# self.clear_cookie("user")
# self.clear_cookie("user_data")
self.clear_cookie("token")
error_msg = "Inncorrect username or password. Please try again."
error_msg = "Incorrect username or password. Please try again."
# log this failed login attempt
self.controller.management.add_to_audit_log(
user_data.user_id, "Tried to log in", 0, self.get_remote_ip()

View File

@ -7,9 +7,11 @@ import argparse
import logging.config
import signal
import peewee
from app.classes.models.users import HelperUsers
from app.classes.shared.import3 import Import3
from app.classes.shared.console import Console
from app.classes.shared.helpers import Helpers
from app.classes.models.users import HelperUsers
console = Console()
helper = Helpers()
@ -133,6 +135,7 @@ if __name__ == "__main__":
# now the tables are created, we can load the tasks_manager and server controller
controller = Controller(database, helper)
import3 = Import3(helper, controller)
tasks_manager = TasksManager(helper, controller)
tasks_manager.start_webserver()
@ -194,7 +197,9 @@ if __name__ == "__main__":
controller.clear_unexecuted_commands()
controller.clear_support_status()
crafty_prompt = MainPrompt(helper, tasks_manager, migration_manager, controller)
crafty_prompt = MainPrompt(
helper, tasks_manager, migration_manager, controller, import3
)
controller_setup_thread = Thread(target=controller_setup, name="controller_setup")