Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

edx-username-changer plugin settings added #424

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/edx_username_changer/BUILD
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should remove cms from entry_points

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
python_sources(
name="edx_username_changer_source",
dependencies=["src/edx_username_changer/settings:edx_username_changer_settings"],
)

python_distribution(
Expand Down
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change the year from 2022 to 2025:
Copyright (C) 2025 MIT Open Learning

File renamed without changes.
2 changes: 1 addition & 1 deletion src/edx_username_changer/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Configurations
--------------
To configure this plugin, you need to do the following one step:

1. Add/Enable a feature flag (ENABLE_EDX_USERNAME_CHANGER) into your environment variables (through ``private.py`` in LMS or CMS, depending upon where you are installing the plugin)
1. Add/Enable a feature flag (ENABLE_EDX_USERNAME_CHANGER) into your environment variables (through ``private.py`` in LMS)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should remove CMS from line 31 as well


.. code-block::

Expand Down
1 change: 1 addition & 0 deletions src/edx_username_changer/settings/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python_sources(name="edx_username_changer_settings")
18 changes: 18 additions & 0 deletions src/edx_username_changer/settings/common.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# noqa: INP001

"""Settings to provide to edX"""


def plugin_settings(settings):
"""
Populate common settings
"""
env_tokens = getattr(settings, "ENV_TOKENS", {})

# .. setting_name: ENABLE_EDX_USERNAME_CHANGER
# .. setting_default: False
# .. setting_description: Enable/Disable the username changer plugin

settings.ENABLE_EDX_USERNAME_CHANGER = env_tokens.get(
"ENABLE_EDX_USERNAME_CHANGER", False
)
10 changes: 10 additions & 0 deletions src/edx_username_changer/settings/devstack.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# noqa: INP001

"""Settings to provide to edX"""


def plugin_settings(settings):
"""
Populate devstack settings
"""
settings.ENABLE_EDX_USERNAME_CHANGER = False
Loading