Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions backend/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,15 @@ def send_bloom():

user = get_current_user()

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

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.



blooms.add_bloom(sender=user, content=request.json["content"])

return jsonify(
Expand Down