-
-
Notifications
You must be signed in to change notification settings - Fork 231
fix: Prevent publishing blog posts that have future publish date #2474
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
base: main
Are you sure you want to change the base?
fix: Prevent publishing blog posts that have future publish date #2474
Conversation
Summary by CodeRabbit
WalkthroughAdded timezone import and modified Post.recent_posts queryset to filter for published posts where published_at is less than or equal to the current time before ordering. Updated corresponding test to validate the filter behavior. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used🧬 Code graph analysis (1)backend/tests/apps/owasp/models/post_test.py (1)
🔇 Additional comments (3)
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 |
|
Proposed change
Resolves #2327
Update recent_posts method to filter posts by publish date and order by most recent
This PR updates the recent_posts() static method in the Post model to ensure only posts published up to the current time are returned, ordered by most recent first.
Checklist
make check-test
locally; all checks and tests passed.