7
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-06-26 08:52:34 +00:00
tutor/tutor/commands/upgrade/common.py
Régis Behmo b3c3c4a2cc feat: upgrade to Palm
Among other changes: ORA2 file uploads were stored in a folder named
"SET-ME-PLEASE (ex.  bucket-name)" (sigh). With this change, the folder
should be automatically renamed to "openedxuploads". This issue has been
occuring since June 2019... (sigh²)

Close #707
2023-06-14 19:40:58 +02:00

50 lines
2.0 KiB
Python

import click
from tutor import config as tutor_config
from tutor import fmt, plugins
from tutor.types import Config
def upgrade_from_lilac(config: Config) -> None:
if not plugins.is_installed("forum"):
fmt.echo_alert(
"The Open edX forum feature was moved to a separate plugin in Maple. To keep using this feature, "
"you must install and enable the tutor-forum plugin: https://github.com/overhangio/tutor-forum"
)
elif not plugins.is_loaded("forum"):
fmt.echo_info(
"The Open edX forum feature was moved to a separate plugin in Maple. To keep using this feature, "
"we will now enable the 'forum' plugin. If you do not want to use this feature, you should disable the "
"plugin with: `tutor plugins disable forum`."
)
plugins.load("forum")
tutor_config.save_enabled_plugins(config)
if not plugins.is_installed("mfe"):
fmt.echo_alert(
"In Maple the legacy courseware is no longer supported. You need to install and enable the 'mfe' plugin "
"to make use of the new learning microfrontend: https://github.com/overhangio/tutor-mfe"
)
elif not plugins.is_loaded("mfe"):
fmt.echo_info(
"In Maple the legacy courseware is no longer supported. To start using the new learning microfrontend, "
"we will now enable the 'mfe' plugin. If you do not want to use this feature, you should disable the "
"plugin with: `tutor plugins disable mfe`."
)
plugins.load("mfe")
tutor_config.save_enabled_plugins(config)
def upgrade_from_nutmeg(context: click.Context, config: Config) -> None:
context.obj.job_runner(config).run_task(
"lms", "./manage.py lms compute_grades -v1 --all_courses"
)
PALM_RENAME_ORA2_FOLDER_COMMAND = """
if stat '/openedx/data/ora2/SET-ME-PLEASE (ex. bucket-name)' 2> /dev/null; then
echo "Renaming ora2 folder..."
mv '/openedx/data/ora2/SET-ME-PLEASE (ex. bucket-name)' /openedx/data/ora2/openedxuploads
fi
"""