This is a wrapper edX app that performs the extra retirement steps once a user requires his account to be deactivated
cd $(tutor config printroot)"/env/build/openedx/requirements
git clone --branch koa-tutor-plugin https://gitlab.com/iblstudios/ibl-edx-gdpr.git
#Enter the lms shell
tutor local run lms bash
pip install -e ../requirement/ibl-edx-gdpr
#Enter the lms shell
tutor local run lms bash
pip uninstall ibl_edx_gdpr
- Add these variables to
ibl-edx-gdpr.yml
and enable the plugintutor plugins enable ibl-edx-gdpr
to be applied tolms/envs/common.py
:
- Enable retirement in LMS
/lms/envs/common.py
, ensureFEATURES = { ... "ACCOUNT_DELETION": True, ... }
<<<<<<< HEAD
-
Set
HOST = <your-edx-domain>
inlms/envs/common.py
to ensure the script works-
Optional settings
IBL_GDPR_USE_HTTPS=False/True <either to connect to HOST using https or http>
=======
-
-
Set
HOST = <your-edx-domain>
inlms/envs/common.py
to ensure the script works -
Configure in
lms.env.json
SALT (For email and username hashing ) and RETIREMENT_SERVICE_WORKER_USERNAME (Only user asides superusers, authorized to perform retirements)RETIRED_USER_SALTS = ['some-Complicated-something', 'some-Complicated-something'] RETIREMENT_SERVICE_WORKER_USERNAME = ibl.retirement.user
7bcbb0f (plugin update and README.md)
-
ibl_edx_gdpr
will be added toINSTALLED_APPS
inlms/envs/common.py
automatically.INSTALLED_APPS = [ #... 'ibl_edx_gdpr' #... ]
-
(Optional) The apps
urlpatterns
will be added tolms/urls.py
automatically.urlpatterns += ( url(r'^api/ibl/retirements/', include('ibl_edx_gdpr.urls')), )
-
Import retirement states
./manage.py lms ibl_retirement_states
- Restart the lms
NOTE: After these steps are done,
- Retirement States Model would be automatically populated with the right RETIREMENT_STATES
- A new user
ibl.retirement.user
would be created - A new Django Oauth Toolkit Application
IBL Retirement App
would be created, (use the credentials for calling the API)
Activate the plugin tutor plugins enable ibl-edx-gdpr
save the new configuration as shown in the terminal config save
Rebuild the image to apply the new config changes
tutor images build openedx --build-arg EDX_PLATFORM_REPOSITORY=https://github.com/edx/edx-platform.git --build-arg EDX_PLATFORM_VERSION=open-release/koa.3
The application can easily retire a learner in two Scenario
Profile Deactivation/Retirement was/is initiated by the user in his user dashboard
-
If user has already clicked the
DELETE MY ACCOUNT
button in his profile. -
Run the
ibl_complete_retirement
command./manage.py lms ibl_complete_retirement --username ibltestuser b'Learner Retirement: (ibltestuser) Starting state RETIRING_ENROLLMENTS' b'Learner Retirement: (ibltestuser) State RETIRING_ENROLLMENTS completed in 0.11639761924743652 seconds' b'Learner Retirement: (ibltestuser) Progressing to state ENROLLMENTS_COMPLETE' b'Learner Retirement: (ibltestuser) Starting state RETIRING_LMS' b'Learner Retirement: (ibltestuser) State RETIRING_LMS completed in 0.10183119773864746 seconds' b'Learner Retirement: (ibltestuser) Progressing to state LMS_COMPLETE' b'Learner Retirement: (ibltestuser) Retirement complete for learner ibltestuser'
User does not exist in retirement pipeline, we would need to deactivate/retire a user profile without needing the user to click deactivate` in account settings.
Note This is a more likely scenerio
- Add User to Retirement Pipeline
./manage.py lms ibl_retire_user --username ibluser --user_email [email protected] User successfully moved to the retirement pipeline
- Run the ibl_complete_retirement command
./manage.py lms ibl_complete_retirement --username ibltestuser b'Learner Retirement: (ibltestuser) Starting state RETIRING_ENROLLMENTS' b'Learner Retirement: (ibltestuser) State RETIRING_ENROLLMENTS completed in 0.11639761924743652 seconds' b'Learner Retirement: (ibltestuser) Progressing to state ENROLLMENTS_COMPLETE' b'Learner Retirement: (ibltestuser) Starting state RETIRING_LMS' b'Learner Retirement: (ibltestuser) State RETIRING_LMS completed in 0.10183119773864746 seconds' b'Learner Retirement: (ibltestuser) Progressing to state LMS_COMPLETE' b'Learner Retirement: (ibltestuser) Retirement complete for learner ibltestuser'
See USAGE for how to use with API, Go to admin, Applications and use the IBL Retirement App Credentials to authenticate with the API
-
JSONDecodeError
- Check that the HOST variable is valid
-
Learner Retirement: Learner [email protected] not found. Please check that the learner is present in UserRetirementStatus, is not already retired, and is in an appropriate state to be acted upon.
- Run the
ìbl_retire_user
command passing the username and email as params
- Run the
-
Connection Refused
- Check if the current can access the url set in
HOST
- Turn off HTTPS by setting
IBL_GDPR_USE_HTTPS
toFalse
- Check if the current can access the url set in