Type: Pull Request Review
Status: Awaiting Prioritization
Affects versions: None
Fix versions: None
This PR adds a new custom management command to create or update the site configuration (`SiteConfiguration` model) for LMS and Studio.
*Sandbox URL*: TBD - sandbox is being provisioned.
*Merge deadline*: None
1. Check out the source branch of the PR.
1. Run the management command with the `--help` flag to check its usage - `python manage.py lms create_or_update_site_configuration --help`.
1. Test the management command by passing the value for the required argument `--site-id`.
1. If there is no `SiteConfiguration` instance for the `Site` corresponding to the given site ID, a new instance is created and the provided values are set in it.
1. The optional site configuration parameters can be provided using the `
- `'a="A B C"'`
- `'a=[1, 2, 3]'`
- `'a=["a", "b", "c"]'`
1. If the optional site configuration parameters are not provided, the site configuration instance is created if it doesn't exist already and left unmodified if it already exists.
1. The site configuration instance can be enabled or disabled by passing either the `-
enabled` or `-disabled` flag. Passing one of these flags without passing any site configuration parameters will result in the behavior mentioned in the previous point and in addition will set the `enabled` field to `True` or `False` based on the flag passed.
1. A YAML file containing the parameters can also be passed as a value to the `-e` argument by prefixing it with the `@` character, for example, `-e @path/to/file.yml` and the parameters are read from the file in that case.
1. A combination of inline parameters and the YAML file can be provided and the parameters provided later in the command will override the ones provided earlier if there is a conflict.
*Author notes and concerns*:
- [ ] @giovannicimolin
- [ ] edX reviewer[s] TBD