fix: scope Personal feed filter to personal projects only#4969
Conversation
The "Personal" toggle in the "My questions and posts" feed previously sent `access=private`, which matched every post whose default project had no default_permission — including private tournaments and other private projects, not just personal projects. Introduce a dedicated `personal` access value backed by a `Post.filter_personal()` manager method that filters by `default_project.type == PERSONAL_PROJECT`, and switch the frontend filter to use it. Closes #1520 Co-authored-by: Sylvain <SylvainChevalier@users.noreply.github.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Collapse filter_personal()'s return to a single line and replace the three sequential access-filter if-branches with a dict dispatch so get_posts_feed stays under the C901 complexity limit. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
QA passed, pending code review @hlbmtc |
🚀 Preview EnvironmentYour preview environment is ready!
Details
ℹ️ Preview Environment InfoIsolation:
Limitations:
Cleanup:
|
Closes #1520
Summary
The "Personal" toggle on the "My questions and posts" feed previously sent
access=private, which on the backend matches every post whose default project has nodefault_permission— i.e. private tournaments and other private projects as well as personal projects. Users saw non-personal private questions under the "Personal" chip.This introduces a dedicated
personalaccess value that filters strictly bydefault_project.type == PERSONAL_PROJECT, and wires the frontend "Personal" filter to it. The existingaccess=privatebehavior is unchanged.Changes
posts/serializers.py— addPERSONALtoPostFilterSerializer.Access.posts/models.py— addPost.objects.filter_personal().posts/services/feed.py— routeaccess=personalto the new filter.front_end/.../my_questions_and_posts.tsx— sendaccess=personal.Test plan
pytest).Generated with Claude Code