Added logs and remove cornerstone from management command
Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/master`
Co-authored-by: zamanafzal <zamanafzal@users.noreply.github.com>
Co-authored-by: Zaman Afzal <zamanafzal@gmail.com>
* feat: added notification when response is endorsed or answered
* test: added and fixed test cases
* fix: fixed lint errors
* refactor: changed method name for readibility
* feat: added notification when my response is endorsed
* test: fixed failed test cases
feat: update cornerstone client to store API calls in DB
Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/master`
Added management command to fix `LearnerDataTransmissionAudit` table records.
Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/master`
Co-authored-by: zamanafzal <zamanafzal@users.noreply.github.com>
Co-authored-by: Zaman Afzal <zamanafzal@gmail.com>
* feat: added setting to disable the survey report banner entirely
* fix: fixed unit test with new setting
* refactor: changed conditions for better code readability
* feat: added exception to stop the report from generating if the setting is set to false
* chore: updated the readme file to include the new setting
* refactor: move survey settings to common and disable admin by setting
* docs: typos in README
Co-authored-by: Tim McCormack <tmccormack@edx.org>
* refactor: set default values to survey report settings
* refactor: rename ENABLE_SURVEY_REPORT setting to SURVEY_REPORT_ENABLE
* test: fix quality tests
---------
Co-authored-by: Alejandro Cardenas <alecar.main@gmail.com>
Co-authored-by: Tim McCormack <tmccormack@edx.org>
* fixed one test to accommodate a slightly modified workflow
* allowed the automated linter to match current standards
Note: as part of this process, I realized a lot of the tests in `programs/tests/test_tasks.py` are somewhat problematic. Some aren't real unit tests (allow calls to something other than the system under test), at least one for that reason it won't run on local at all, and some mock the wrong part of the system or just don't match current flow. I'm not modifying them as part of this, but they should be looked at.
FIXES: APER-3146
To determine whether or not we need to revoke any program certificates, we first run get_revokable_program_uuids. This calls get_certified_programs, which calls get_credentials, which uses the OpenEdx Core utility method get_api_data. get_api_data makes the API call inside a try block, does raise_for_status also inside the try block, and then catches the exception, logs it, and returns an empty result to the caller.
This means that on a failure to call the credentials API, get_credentials can’t tell the difference between a failure to hit the API (because credentials is, as it sometimes is during a notify_programs run, overloaded), or a learner with no program certificates. In this particular case, this is absolute failure, incorrect behavior.
* Adds a new flag, `raise_on_error` which will make `get_api_data` log the exception and then re-raise the HTTPError, defaulting to false in order to avoid changing the behavior on any other callers
* Also: my editor reformatted all of the touched files to our modern code standards, and it seemed appropriate to let it do that.
* Also: added type hints in some cases, because they helped me write the code and debug. Our test suite definitely reports mypy results on type errors so we are verifying that hints are correct.
FIXES: APER-3146