Skip to content

ZA | 25-SDC-JULY | Luke Manyamazi | Sprint 1 | New Feature Rebloom - #257

Open
Luke-Manyamazi wants to merge 1 commit into
CodeYourFuture:mainfrom
Luke-Manyamazi:feature-rebloom
Open

ZA | 25-SDC-JULY | Luke Manyamazi | Sprint 1 | New Feature Rebloom#257
Luke-Manyamazi wants to merge 1 commit into
CodeYourFuture:mainfrom
Luke-Manyamazi:feature-rebloom

Conversation

@Luke-Manyamazi

@Luke-Manyamazi Luke-Manyamazi commented Jul 7, 2026

Copy link
Copy Markdown

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 code for the new feature rebloom

Briefly explain your PR.
This PR is for the new feature rebloom exercise. I hope all this time I have met all the requirements to make this PR pass.

Questions

I do not have any questions.

Ask any questions you have for your reviewer. You must remove this section if you have no 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. 🏕 Priority Mandatory labels Jul 7, 2026

@illicitonion illicitonion left a comment

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.

This generally looks pretty good, but when I run it locally and open up http://localhost:8000 the page is mostly empty and there's an error in the console. Can you take a look at that?

Comment thread backend/data/blooms.py
Comment on lines +22 to +24
original_bloom_id: Optional[int] = None
original_sender: Optional[str] = None
original_sent_timestamp: Optional[datetime.datetime] = None

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.

Rather than having three Optional properties here which are always either set or not, I'd recommend extracting a RebloomDetails class and having a single Optional[RebloomDetails] property.

That way you don't need to worry in code about the (hopefully impossible!) possibility that original_bloom_id is set where original_sender isn't - we make clear through the types the properties are grouped and are all present or all absent.

Comment thread backend/data/blooms.py
),
EXISTS(
SELECT 1 FROM blooms rb2
WHERE rb2.sender_id = %(current_user_id)s

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.

With this clause, will users who aren't logged in still be able to see blooms?

Comment thread backend/main.py
Comment on lines +51 to +61
# Force JSON error bodies everywhere - Flask's default HTML error pages
# break frontend code that expects response.json() to succeed.
@app.errorhandler(HTTPException)
def handle_http_exception(error):
return jsonify({"success": False, "message": error.description}), error.code

@app.errorhandler(Exception)
def handle_unexpected_exception(error):
app.logger.exception(error)
return jsonify({"success": False, "message": "Internal server error"}), 500

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.

This is a nice improvement!

In real life I'd expect this as a separate PR, but I can believe this helped you to debug things a lot on the way so I'm not going to complain about having it in this one :)

Comment thread db/schema.sql
content TEXT NOT NULL,
send_timestamp TIMESTAMP NOT NULL
send_timestamp TIMESTAMP NOT NULL,
original_bloom_id BIGINT REFERENCES blooms(id)

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.

This is good data modelling, well done!

@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 Jul 17, 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. 🏕 Priority Mandatory 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