Skip to content

ZA | 25-SDC-JULY | Luke Manyamazi | Sprint 1 | Extra long bloom#185

Open
Luke-Manyamazi wants to merge 3 commits intoCodeYourFuture:mainfrom
Luke-Manyamazi:BR-Extra-long-bloom
Open

ZA | 25-SDC-JULY | Luke Manyamazi | Sprint 1 | Extra long bloom#185
Luke-Manyamazi wants to merge 3 commits intoCodeYourFuture:mainfrom
Luke-Manyamazi:BR-Extra-long-bloom

Conversation

@Luke-Manyamazi
Copy link
Copy Markdown

@Luke-Manyamazi Luke-Manyamazi commented Apr 17, 2026

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

Added 280-character validation for blooms in backend (add_bloom) and database (CHECK constraint) to prevent oversized posts.
Updated frontend createBloom to visually flag blooms exceeding 280 characters for better user feedback.

Questions

None, I do not have any questions.

@Luke-Manyamazi Luke-Manyamazi 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 Apr 17, 2026
Copy link
Copy Markdown
Member

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

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

LGTM, one thing to look at :)

Comment thread backend/data/blooms.py Outdated
Comment on lines +19 to +20
if len(content) > 280:
raise ValueError("Bloom must not exceed 280 characters")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If you changed the character limit, you'd need to change it in two places (and could easily forget one) - can you think how to avoid this?

The same applies in your JavaScript. Often we need to duplicate things for different languages, but within one language we should be able to avoid this duplication :)

@illicitonion illicitonion 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 Apr 22, 2026
@Luke-Manyamazi
Copy link
Copy Markdown
Author

Thank you for the feedback. I’ve introduced a MAX_BLOOM_LENGTH constant in data/blooms.py and a matching constant in the JavaScript logic.

const createBloom = (template, bloom) => {
if (!bloom) return;

const MAX_BLOOM_LENGTH = 280;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There are still three occurrences of 280 in this file?

Co-authored-by: Copilot <copilot@github.com>
@Luke-Manyamazi
Copy link
Copy Markdown
Author

I have fixed the 2 lines using ${MAX_BLOOM_LENGTH}

@Luke-Manyamazi Luke-Manyamazi added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 25, 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. Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 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