Repository navigation
fix: support learner search for users with posts but no enrollment - #65
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The MongoDB query retrieves unnecessarily large documents, and the release bump lacks the required changelog entry.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Adds a public forum API for finding course participants with discussion activity, including unenrolled posters.
Changes:
- Implements case-insensitive username lookup for MongoDB and MySQL.
- Exports the API and adds cross-backend tests.
- Bumps the package version to 0.7.3.
| File | Description |
|---|---|
tests/e2e/test_users.py |
Tests matching, course filtering, and regex escaping. |
forum/backends/mysql/api.py |
Implements MySQL username lookup. |
forum/backends/mongodb/api.py |
Implements MongoDB username lookup. |
forum/backends/backend.py |
Extends the backend interface. |
forum/api/users.py |
Adds the public API wrapper. |
forum/api/__init__.py |
Exports the new API. |
forum/__init__.py |
Bumps the package version. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| """ | ||
|
|
||
| __version__ = "0.7.2" | ||
| __version__ = "0.7.3" |
rahulkanneri-2u
approved these changes
Sep 30, 2026
Author
|
@copilot resolve the merge conflicts in this pull request |
Co-authored-by: Alam-2U <217736558+Alam-2U@users.noreply.github.com>
Resolved the merge conflict with |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.


Description
Learner search in the Discussions "Learners" tab did not show learners who had posted in the course but were not enrolled in it.
Cause
The search matched usernames only against course enrollments, so anyone without an enrollment was left out even when they had posts. The regular Learners list is built from forum stats, which is why these users showed up there but not in search.
Fix
get_usernames_with_course_stats. It returns users who have discussion stats in the course and whose username matches the search.Ticket : LP-1269