Issue with patches

Hi
in my edx, I wanted to add an email to “STUDIO_REQUEST_EMAIL” via patches.
I found this topic but his method is not working.

I followed these steps, which did not work.

  • I created a plugin called custom-settings.yml in tutor plugins printroot path and added the following lines:
name: custom-settings
version: 1.0.0
patches:

  cms-env-features: |
    "STUDIO_REQUEST_EMAIL": "something@something.com"

  • enabled it via tutor plugins enable custom-settings
  • create new envs and configs with tutor config save
  • at last, I started it with tutor local quickstart.

but it didn’t work :frowning:
I checked the /openedx/edx-platform/cms/envs/common.py file and it didn’t have any value:
'STUDIO_REQUEST_EMAIL': ''
am I doing something wrong?

Did you successfully add your changes to your environment? You can check by running:

grep -R STUDIO_REQUEST_EMAIL "$(tutor config printroot)/env/apps/openedx"

Yes, the changes are available in multiple json files:
tutor/env/apps/openedx/config/cms.env.json: “STUDIO_REQUEST_EMAIL”: “myemail@gmail.com”,
tutor/env/apps/openedx/config/cms.env.json: “STUDIO_REQUEST_EMAIL”: “myemail@gmail.com”,
tutor/env/apps/openedx/config/lms.env.json: “STUDIO_REQUEST_EMAIL”: “myemail@gmail.com”,

but not available in the containers. for example, inside the cms container, I used grep -R STUDIO_REQUEST_EMAIL and this came back:
cms/envs/common.py: ‘STUDIO_REQUEST_EMAIL’: ‘’

@CodeWithEmad you were searching in the wrong directory which is expected to have the cms config.

The directory tutor/env/apps/openedx/config (which the cms-env-features patch is adding to) will be mounted to /openedx/config/ hence [1].
So the patch config did exist in the caontiner, but I am not sure if or how it should be loaded by the django, may be important to note that the cms.env.json file is being exposed to the cms through this ENV STUDIO_CFG variable hence [2],

Ref:
[1]:tutor/docker-compose.yml at 030d56f9af472a0caa4b667961785bc2237e9982 · overhangio/tutor · GitHub
[2]: tutor/Dockerfile at 030d56f9af472a0caa4b667961785bc2237e9982 · overhangio/tutor · GitHub

1 Like