openedx / openedx/openedx-platform
cleanup direct model imports from certificates djangoapp
Open
@wgu-ram-chandra is already working on this.
Since May 2, 2025.
good first issue
help wanted
- Dominant language
- Python
- Stars
- 8.2k
- Forks
- 4.4k
- Avg merge
- 6d 18h
- Merged PRs (30d)
- 42
Description
There are a small number of direct imports from the certificates djangoapp's models.py. Wherever possible, we want to use the app's API) or data classes for use outside of the certificates app itself.
As of this writing, this appears to be all imports of the app that are not from api.py, data.py, test factories, the signals, or an exception definition:
- 16 direct imports from models, which mostly look like they can be replaced with data classes for GeneratedCertificate or CertificateGenerationHistory
- one possibly-unavoidable import in order to patch in a unit test
the majority of them appear to be in legacy front-ends, unsurprisingly.
Acceptance Criteria
- create any necessary data classes to get rid of direct imports of
lms.djangoapps.certificates.modelsfrom outside the django app - change the code to reference the appropriate data class or API method
- if it is difficult, costly, or impossible to make the change, consider adding a comment explaining why
- verify that all the affected apps still work properly, and that all the tests pass
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.