Skip to content

London| SDC-Nov-2025| Ikenna Agulobi | Sprint 1 | bug/ Extra long blooms#166

Open
ike-agu wants to merge 1 commit intoCodeYourFuture:mainfrom
ike-agu:Extra-long-blooms
Open

London| SDC-Nov-2025| Ikenna Agulobi | Sprint 1 | bug/ Extra long blooms#166
ike-agu wants to merge 1 commit intoCodeYourFuture:mainfrom
ike-agu:Extra-long-blooms

Conversation

@ike-agu
Copy link

@ike-agu ike-agu commented Feb 25, 2026

  • Implemented length checks in endpoint with HTTP 400 responses.
  • Added a safety validation in to protect the database layer.

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

Changelist

This PR implements character limit enforcement for "Blooms". Also prevents oversized data from being stored in the database.

Changes:

API: Updated send_bloom in endpoint.py to validate content length and return a 400 Bad Request if the limit is exceeded.
Backend: Added a ValueError check in blooms.py as a secondary safety measure.

How to Test:

  • Open the "Share a Bloom" form.
  • Verify you cannot type more than 280 characters.
  • (Optional) Use an API tool like Postman to try and send a 300-character string to the /send_bloom endpoint.
    Verify the server returns a 400 error with the message: "Bloom is too long! Max 280 characters."

- Implemented length checks in  endpoint with HTTP 400 responses.
- Added a safety validation in  to protect the database layer.
@ike-agu ike-agu added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 25, 2026
@OracPrime OracPrime added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Feb 28, 2026
Copy link

@OracPrime OracPrime left a comment

Choose a reason for hiding this comment

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

You need to harmonize you MAX_CHARACTERS between files

content = request.json["content"]

#----Validation-----
if len(content) > 280:

Choose a reason for hiding this comment

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

Argh! You did so well to introduce a constant in the other file. You need to use the same constant here too!

@github-project-automation github-project-automation bot moved this from Backlog to In Progress in Purple Forest Kanban Feb 28, 2026
@OracPrime OracPrime added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Feb 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants