Conversation
- Update `backend/models/report.py` to support legacy fallback in `get_pending_reports` and `get_recent_reports` for backward compatibility. - Ensure `_enrich_report_with_details` correctly fetches post and comment content. - Fix bugs in `Post.report_post`, `Comment.report_comment`, and `Message.report_message` where `create_report` was called with incorrect positional arguments. - Add comments to `_enrich_report_with_details` for clarity.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This PR addresses the issue of missing report support for posts and comments by fixing bugs in how reports are created and retrieved.
Changes:
Reportretrieval methods: Updatedget_pending_reportsandget_recent_reportsinbackend/models/report.pyto filter bytopic_idcorrectly, with a fallback to legacyreported_message_idlookup to ensure existing reports are still visible. Updatedget_user_reportsto checkreported_user_id.create_reportcalls inbackend/models/post.py,backend/models/comment.py, andbackend/models/message.pyto use keyword arguments, ensuring thatcontent_type,content_id,topic_id, andreported_user_idare passed correctly. Previously, incorrect positional arguments were leading to corrupted report data._enrich_report_with_detailsinbackend/models/report.pyto explicitly document the logic for fetching post and comment details.backend/repro_report.py(which was run and then deleted) to verify the fixes.PR created automatically by Jules for task 15231206498711219601 started by @8JP8