Question about the compatibility of the edx-username-changer plugin with recent Open edX versions

Hello everyone

I’m currently having trouble changing usernames on our Open edX instance. We’ve been trying to use the edx-username-changer plugin to make these changes through the admin panel, but after following the setup instructions, we haven’t seen any changes in functionality.

We are running a newer version of Open edX(V17 Quince) with Django 4.2, and I am wondering if this plugin is compatible with the most recent versions of the platform. Has anyone managed to make it work in a similar environment?

We would prefer to avoid deleting users and causing them to lose progress. Any suggestions or experiences with this topic? Or is there an alternative way to update usernames in bulk without losing data?

I would really appreciate any advice!

Hi @jimenez,

As per the GitHub - mitodl/edx-username-changer: A plugin to enable update usernames through admin panel in Open edX (and other apps that log into Open edX via OAuth) did you enable the below ?

FEATURES:
  ...
  ...
  ENABLE_EDX_USERNAME_CHANGER: true
  ...

Yes, I added it in the lms.env.yml file, then I did a platform reboot(tutor images build openedx), but the changes are not showing

Hi @jimenez,

I tried on our forked version of Redwood. It is still working.

Kind regards, Ivo Branco.

Could you help me with the steps you followed? I still can’t make it work for me. Maybe I’m skipping a step

@jimenez

You should create a tutor plugin, for example features.yml like:

name: features
version: 0.1.0
patches:
  common-env-features: |
     ENABLE_EDX_USERNAME_CHANGER: true

Enable the plugin

tutor plugins install features

Save the configuration

tutor config save

Restart the LMS

tutor local restart lms

I’ve been trying these days, but I haven’t been successful, I’m working with version 17.0.5, I did all the steps, but I haven’t succeeded. I still don’t know if there’s anything before that isn’t activating

Hi @jimenez

I tried it in edx-platform master branch using tutor-nightly and it worked for me.

Can you make sure that the edx-username-changer package is installed properly ?
You can check it via tutor local run lms pip freeze | grep username
If its installed please verify your settings if they are properly set using
tutor local run lms ./manage.py lms print_setting FEATURES (it will print a lot of information) you can search for ENABLE_EDX_USERNAME_CHANGER

Hi @jimenez sorry to resurrect an old thread, but did you ever manage to get this working? I’ve tried installing on Palm, Quince and Redwood with the same results, doesn’t offer any new functionality (there is no option to change username). I’d also made a similar post back in April (here) but nobody seemed to have any info for me there.

@marslan if I run tutor local run lms pip freeze | grep username i get nothing:

tutor local run lms pip freeze | grep username
[+] Creating 6/0
:heavy_check_mark: Container tutor_local-smtp-1 Running0.0s
:heavy_check_mark: Container tutor_local-mysql-1 Running0.0s
:heavy_check_mark: Container tutor_local-permissions-1 Created0.0s
:heavy_check_mark: Container tutor_local-redis-1 Running0.0s
:heavy_check_mark: Container tutor_local-elasticsearch-1 Running0.0s
:heavy_check_mark: Container tutor_local-mongodb-1 Running0.0s
[+] Running 1/1
:heavy_check_mark: Container tutor_local-permissions-1 Started0.2s

If I run tutor local run lms ./manage.py lms print_setting FEATURES then right near the end I do see it there:

ENABLE_EDX_USERNAME_CHANGER': True

I also created a plugin as suggested by @IvoBranco, saved config, build images, restart platform, all the usual stuff…

It appears to me that this edx-username-changer is not functional on Tutor at all

Have you installed the package on the LMS?

OPENEDX_EXTRA_PIP_REQUIREMENTS
- edx-username-changer==0.3.1

Reference: Configuration and customisation — Tutor documentation

1 Like

Ok so I hadn’t done exactly that, but I’ve tried it now:
run following:

tutor config save --append OPENEDX_EXTRA_PIP_REQUIREMENTS=git+https://github.com/mitodl/edx-username-changer.git
tutor images build openedx
tutor local restart

The command tutor local run lms pip freeze | grep username still does nothing

[+] Creating 6/0
:heavy_check_mark: Container tutor_local-mysql-1 Running0.0s
:heavy_check_mark: Container tutor_local-smtp-1 Running0.0s
:heavy_check_mark: Container tutor_local-permissions-1 Created0.0s
:heavy_check_mark: Container tutor_local-elasticsearch-1 Running0.0s
:heavy_check_mark: Container tutor_local-mongodb-1 Running0.0s
:heavy_check_mark: Container tutor_local-redis-1 Running0.0s
[+] Running 1/1
:heavy_check_mark: Container tutor_local-permissions-1 Started0.3s

What am I doing wrong?

1 Like

I think a restart is different than a stop and start. I think a restart won’t use the new docker image that you just have built.

1 Like

ok so i tried now to do tutor local stop && tutor local start -d but the result is still the same.

Just to satisfy my curiosity i also tried something different like this which looks like it did install the package:
tutor local run lms pip install edx-username-changer

docker compose -f /home/tutor/.local/share/tutor/env/local/docker-compose.yml -f /home/tutor/.local/share/tutor/env/local/docker-compose.prod.yml --project-name tutor_local run --rm lms pip install edx-username-changer
[+] Creating 6/0
:heavy_check_mark: Container tutor_local-mysql-1 Running 0.0s
:heavy_check_mark: Container tutor_local-smtp-1 Running 0.0s
:heavy_check_mark: Container tutor_local-permissions-1 Created 0.0s
:heavy_check_mark: Container tutor_local-elasticsearch-1 Running 0.0s
:heavy_check_mark: Container tutor_local-mongodb-1 Running 0.0s
:heavy_check_mark: Container tutor_local-redis-1 Running 0.0s
[+] Running 1/1
:heavy_check_mark: Container tutor_local-permissions-1 Started 0.2s
Collecting edx-username-changer
Downloading edx_username_changer-0.3.2-py2.py3-none-any.whl.metadata (2.2 kB)
Downloading edx_username_changer-0.3.2-py2.py3-none-any.whl (19 kB)
Installing collected packages: edx-username-changer
Successfully installed edx-username-changer-0.3.2

but it still doesn’t show up under pip freeze:
tutor local run lms pip freeze

docker compose -f /home/tutor/.local/share/tutor/env/local/docker-compose.yml -f /home/tutor/.local/share/tutor/env/local/docker-compose.prod.yml --project-name tutor_local run --rm lms pip freeze
[+] Creating 6/0
:heavy_check_mark: Container tutor_local-mysql-1 Running 0.0s
:heavy_check_mark: Container tutor_local-smtp-1 Running 0.0s
:heavy_check_mark: Container tutor_local-permissions-1 Created 0.0s
:heavy_check_mark: Container tutor_local-redis-1 Running 0.0s
:heavy_check_mark: Container tutor_local-mongodb-1 Running 0.0s
:heavy_check_mark: Container tutor_local-elasticsearch-1 Running 0.0s
[+] Running 1/1
:heavy_check_mark: Container tutor_local-permissions-1 Started 0.2s
EDIT: removed the long list of apps

not too sure, but maybe I was just being an idiot… :upside_down_face:
after running tutor local launch it seems that it shows in the pip freeze list now.

tutor local run lms pip freeze | grep username
[+] Creating 6/0
:heavy_check_mark: Container tutor_local-mysql-1 Running0.0s
:heavy_check_mark: Container tutor_local-smtp-1 Running0.0s
:heavy_check_mark: Container tutor_local-permissions-1 Created0.0s
:heavy_check_mark: Container tutor_local-redis-1 Running0.0s
:heavy_check_mark: Container tutor_local-mongodb-1 Running0.0s
:heavy_check_mark: Container tutor_local-elasticsearch-1 Running0.0s
[+] Running 1/1
:heavy_check_mark: Container tutor_local-permissions-1 Started0.2s
edx-username-changer @ git+https://github.com/mitodl/edx-username-changer.git@fd3e71f94782052ca62552f6d46f5ed7ee136257

in the Django admin I was expecting to see something different like a button/link to change username, but all I had to do was edit the value in the username block and save, so I guess it does work :smiley: YAY!

Thank you @IvoBranco for entertaining my ignorance :slight_smile:

1 Like

Hello, these steps worked the same for me, in my case I did not use the tutor local launch but only the tutor images build openedx, but in case it does not recognize it, it would be necessary to make the tutor local launch. Thank you very much friends and sorry for the time, the time difference means that I cannot answer right away.