RDI Access change for retrieving data from Kobo Reinstated #4507
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
AB#198299
This pull request includes several changes to the
kobo
API and related files to improve the functionality and maintainability of the codebase. The most important changes include the refactoring of theKoboAPI
class, updates to the environment configurations, and removal of deprecated code.Refactoring of
KoboAPI
class:src/hct_mis_api/apps/core/kobo/api.py
: Refactored theKoboAPI
class to simplify initialization and request handling, including the removal of theBusinessArea
dependency and the introduction of_get_request
and_get_paginated_request
methods. [1] [2] [3] [4] [5]Updates to environment configurations:
development_tools/.env.example
: AddedKOBO_PROJECT_VIEWS_ID
to the.env.example
file.src/hct_mis_api/config/env.py
: AddedKOBO_PROJECT_VIEWS_ID
to the environment configuration.src/hct_mis_api/config/settings.py
: AddedKOBO_PROJECT_VIEWS_ID
to the settings.Removal of deprecated code:
src/hct_mis_api/apps/core/kobo/common.py
: Removed thefilter_by_owner
function.src/hct_mis_api/apps/core/models.py
: Markedkobo_username
as deprecated with a TODO comment for future removal.Additional changes:
src/hct_mis_api/apps/core/schema.py
: Updatedresolve_asset
andresolve_assets_list
functions to use the refactoredKoboAPI
class and handle the newCountryCodeNotProvided
exception. [1] [2] [3] [4]tests/unit/apps/core/kobo/cassettes/TestKoboAPI.test_get_project_submissions_only_active_submissions.yaml
: Added a new test cassette for thetest_get_project_submissions_only_active_submissions
method.