Skip to content

London | 26-SDC-March | Zobeir Rigi | Legacy-Code |Sprint 1 | Bug-Report-Extra-long-blooms - #250

Open
Zobeir-Rigi wants to merge 1 commit into
CodeYourFuture:mainfrom
Zobeir-Rigi:bloom-character-limit
Open

London | 26-SDC-March | Zobeir Rigi | Legacy-Code |Sprint 1 | Bug-Report-Extra-long-blooms#250
Zobeir-Rigi wants to merge 1 commit into
CodeYourFuture:mainfrom
Zobeir-Rigi:bloom-character-limit

Conversation

@Zobeir-Rigi

Copy link
Copy Markdown
  • 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

Bug

Blooms longer than 280 characters could be posted even though blooms are intended to be limited to 280 characters.

Fix

Added backend validation to reject blooms that exceed the 280-character limit before they are saved.

@Zobeir-Rigi Zobeir-Rigi added 📅 Sprint 1 Assigned during Sprint 1 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Legacy-Code The name of the module. labels Jul 4, 2026
@Zobeir-Rigi Zobeir-Rigi changed the title London | 26-SDC-March | Zobeir Rigi | Legacy-Code |Sprint 1 | Enforce 280 character limit for blooms London | 26-SDC-March | Zobeir Rigi | Legacy-Code |Sprint 1 | Bug-Report-Extra-long-blooms Jul 14, 2026

@cjyuan cjyuan left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You identified the place to change in order to fix the bug, but the change could still be improved.

Comment thread backend/endpoints.py
Comment on lines +161 to +167
if len(request.json["content"]) > 280:
return jsonify(
{
"success": False,
"message": "Bloom must not exceed 280 characters",
}
), 400

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

  • Why not replace the magic number 280 by a named constant?

  • Can the code run? The syntax does not look right.

@cjyuan cjyuan 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. labels Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Legacy-Code The name of the module. Reviewed Volunteer to add when completing a review with trainee action still to take. 📅 Sprint 1 Assigned during Sprint 1 of this module

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants