-
Notifications
You must be signed in to change notification settings - Fork 337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable search for OrganizationUsers #2739
Enable search for OrganizationUsers #2739
Conversation
📝 WalkthroughWalkthroughThe pull request introduces a new filter class Changes
Possibly related PRs
Suggested reviewers
Poem
Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
care/emr/api/viewsets/organization.py (2)
201-202
: Perhaps we could add a docstring to enlighten future maintainers?The filter implementation looks good, but a docstring explaining the purpose and usage of this filter class would be really nice to have.
class OrganizationUserFilter(filters.FilterSet): + """Filter class for OrganizationUser model, enabling username-based search.""" username = filters.CharFilter(field_name="user__username", lookup_expr="icontains")
🧰 Tools
🪛 GitHub Actions: Lint Code Base
[warning] 201-201: Code formatting issue detected and auto-fixed by ruff-format. A blank line was added after the OrganizationUserFilter class definition.
209-210
: Looks good, though we could potentially do more...The filter integration is clean and well-implemented. While we're at it, have you considered adding other useful filters like
role
orclass OrganizationUserFilter(filters.FilterSet): username = filters.CharFilter(field_name="user__username", lookup_expr="icontains") + email = filters.CharFilter(field_name="user__email", lookup_expr="icontains") + role = filters.CharFilter(field_name="role__name", lookup_expr="icontains")
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
care/emr/api/viewsets/organization.py
(1 hunks)
🧰 Additional context used
🪛 GitHub Actions: Lint Code Base
care/emr/api/viewsets/organization.py
[warning] 201-201: Code formatting issue detected and auto-fixed by ruff-format. A blank line was added after the OrganizationUserFilter class definition.
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: test / test
🔇 Additional comments (1)
care/emr/api/viewsets/organization.py (1)
201-203
: Thanks for letting ruff-format handle the spacing.The formatting has been automatically fixed. Moving forward, you might want to run
ruff format
locally before committing to avoid these tiny surprises.🧰 Tools
🪛 GitHub Actions: Lint Code Base
[warning] 201-201: Code formatting issue detected and auto-fixed by ruff-format. A blank line was added after the OrganizationUserFilter class definition.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #2739 +/- ##
===========================================
+ Coverage 60.43% 60.45% +0.01%
===========================================
Files 252 252
Lines 12697 12701 +4
Branches 1111 1111
===========================================
+ Hits 7674 7678 +4
Misses 4954 4954
Partials 69 69 ☔ View full report in Codecov by Sentry. |
Proposed Changes
Associated Issue
Merge Checklist
/docs
Only PR's with test cases included and passing lint and test pipelines will be reviewed
@ohcnetwork/care-backend-maintainers @ohcnetwork/care-backend-admins
Summary by CodeRabbit