Skip to content

Manchester | 25-SDC-Nov | Rahwa Haile | Sprint 1 | Bug Report: Extra long blooms?#143

Open
RahwaZeslusHaile wants to merge 3 commits intoCodeYourFuture:mainfrom
RahwaZeslusHaile:extra-bloom
Open

Manchester | 25-SDC-Nov | Rahwa Haile | Sprint 1 | Bug Report: Extra long blooms?#143
RahwaZeslusHaile wants to merge 3 commits intoCodeYourFuture:mainfrom
RahwaZeslusHaile:extra-bloom

Conversation

@RahwaZeslusHaile
Copy link

Manchester | 25-SDC-Nov | Rahwa Haile | Sprint 1 | Bug Report: Extra long blooms?

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Fix: Enforce 280-character limit on blooms

Description

This PR fixes a bug where blooms could be posted with content exceeding the intended 280-character limit. The frontend enforces this limit via a textarea maxlength attribute, but the backend had no validation, allowing blooms to bypass the restriction.

Changes

  • backend/endpoints.py: Added validation to the send_bloom() endpoint to reject blooms longer than 280 characters with a 400 error response
  • backend/populate.py: Shortened AS's seed bloom from 332 to 253 characters to comply with the new limit

Why This Matters

  • Blooms are Twitter-inspired and should maintain the 280-character limit
  • Without backend validation, users could post oversized blooms via API calls
  • AS's seed data now complies with the limit, preventing populate script failures

Testing

  • Seed data populates successfully with the corrected bloom length
  • Backend validation prevents posting blooms > 280 characters
  • Existing shorter blooms are unaffected

Please review my work — thank you!

@RahwaZeslusHaile RahwaZeslusHaile added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed.

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant