Skip to content

fix: enforce CreatePostForm validation on post creation#257

Merged
DogukanUrker merged 1 commit into
DogukanUrker:mainfrom
GoodVaibhs:fix/create-post-validation
Jun 20, 2026
Merged

fix: enforce CreatePostForm validation on post creation#257
DogukanUrker merged 1 commit into
DogukanUrker:mainfrom
GoodVaibhs:fix/create-post-validation

Conversation

@GoodVaibhs

Copy link
Copy Markdown
Contributor

CreatePostForm was instantiated in create_post() but .validate() was never called, so all its validators (title length, required tags, abstract length, etc.) were silently bypassed. The handler read raw values straight from request.form and only checked that content and abstract were non-empty.

This let a 1-character title or empty tags field through, while the form's own rules (Length(min=4, max=75) on title, InputRequired() on tags/category, Length(min=150, max=200) on abstract) were never enforced.

Validate the form and use its cleaned field data when building the new Post; fall back to the existing 'empty' flash message on failure and log the specific validation errors.

CreatePostForm was instantiated in create_post() but .validate() was never called, so all its validators (title length, required tags, abstract length, etc.) were silently bypassed. The handler read raw values straight from request.form and only checked that content and abstract were non-empty.

This let a 1-character title or empty tags field through, while the form's own rules (Length(min=4, max=75) on title, InputRequired() on tags/category, Length(min=150, max=200) on abstract) were never enforced.

Validate the form and use its cleaned field data when building the new Post; fall back to the existing 'empty' flash message on failure and log the specific validation errors.
@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@GoodVaibhs, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 28 minutes and 45 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 695273c4-2b75-4a82-b563-c76998cc635a

📥 Commits

Reviewing files that changed from the base of the PR and between fe7a05a and 5c6a32d.

📒 Files selected for processing (1)
  • app/routes/create_post.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@DogukanUrker DogukanUrker self-requested a review June 20, 2026 06:33

@DogukanUrker DogukanUrker left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@DogukanUrker DogukanUrker merged commit c3bc6a3 into DogukanUrker:main Jun 20, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants