ZA | 25-SDC-JULY | Luke Manyamazi | Sprint 1 | Extra long bloom#185
Open
Luke-Manyamazi wants to merge 3 commits intoCodeYourFuture:mainfrom
Open
ZA | 25-SDC-JULY | Luke Manyamazi | Sprint 1 | Extra long bloom#185Luke-Manyamazi wants to merge 3 commits intoCodeYourFuture:mainfrom
Luke-Manyamazi wants to merge 3 commits intoCodeYourFuture:mainfrom
Conversation
Member
illicitonion
left a comment
There was a problem hiding this comment.
LGTM, one thing to look at :)
Comment on lines
+19
to
+20
| if len(content) > 280: | ||
| raise ValueError("Bloom must not exceed 280 characters") |
Member
There was a problem hiding this comment.
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 :)
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; |
Member
There was a problem hiding this comment.
There are still three occurrences of 280 in this file?
Co-authored-by: Copilot <copilot@github.com>
Author
|
I have fixed the 2 lines using ${MAX_BLOOM_LENGTH} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Learners, PR Template
Self checklist
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.