mirror of
https://github.com/ChristianLight/tutor.git
synced 2024-12-12 14:17:46 +00:00
feat: add a do print-edx-platform-setting
command
The command is pretty straightforward, but quite convenient.
This commit is contained in:
parent
b3c5c9685b
commit
586045143f
@ -1 +1,2 @@
|
||||
- [Feature] Make it possible to import the demo course from a different git repository or version. (by @regisb)
|
||||
- [Feature] Add a convenient `do print-edx-platform-setting` command to print the value of an edx-platform setting. (by @regisb)
|
||||
|
@ -222,6 +222,26 @@ def assign_theme(name, domain):
|
||||
return f'./manage.py lms shell -c "{python_command}"'
|
||||
|
||||
|
||||
@click.command(
|
||||
name="print-edx-platform-setting",
|
||||
help="Print the value of an edx-platform Django setting.",
|
||||
)
|
||||
@click.argument("setting")
|
||||
@click.option(
|
||||
"-s",
|
||||
"--service",
|
||||
type=click.Choice(["lms", "cms"]),
|
||||
default="lms",
|
||||
show_default=True,
|
||||
help="Service to fetch the setting from",
|
||||
)
|
||||
def print_edx_platform_setting(
|
||||
setting: str, service: str
|
||||
) -> t.Iterable[tuple[str, str]]:
|
||||
command = f"./manage.py {service} shell -c 'from django.conf import settings; print(settings.{setting})'"
|
||||
yield (service, command)
|
||||
|
||||
|
||||
def add_job_commands(do_command_group: click.Group) -> None:
|
||||
"""
|
||||
This is meant to be called with the `local/dev/k8s do` group commands, to add the
|
||||
@ -300,6 +320,7 @@ hooks.Filters.CLI_DO_COMMANDS.add_items(
|
||||
createuser,
|
||||
importdemocourse,
|
||||
initialise,
|
||||
print_edx_platform_setting,
|
||||
settheme,
|
||||
]
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user