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
10 changes: 10 additions & 0 deletions backend/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,16 @@ def send_bloom():

user = get_current_user()

content = request.json["content"]

MAX_BLOOM_LENGTH = 280
# Enforce maximum bloom length
if len(content) > MAX_BLOOM_LENGTH:
return jsonify({
"success": False,
"error": f"Bloom must be {MAX_BLOOM_LENGTH} characters or fewer."
}), 400

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

return jsonify(
Expand Down