Skip to content
Open
Show file tree
Hide file tree
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
14 changes: 12 additions & 2 deletions backend/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,18 @@ def send_bloom():
return type_check_error

user = get_current_user()

blooms.add_bloom(sender=user, content=request.json["content"])
#debugged for extra long bloom
content = request.json.get("content","")
MAX_BLOOM_LENGTH = 500
if len(content) > MAX_BLOOM_LENGTH:
return make_response(
{
"success": False,
"message": f"Bloom cannot exceed {MAX_BLOOM_LENGTH} characters",
},
400,
)
blooms.add_bloom(sender=user, content=content)

return jsonify(
{
Expand Down
2 changes: 1 addition & 1 deletion backend/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ idna==3.10
itsdangerous==2.2.0
Jinja2==3.1.5
MarkupSafe==3.0.2
psycopg2==2.9.10
psycopg2-binary==2.9.10
pycparser==2.22
PyJWT==2.10.1
python-dotenv==1.0.1
Expand Down
4 changes: 2 additions & 2 deletions front-end/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,11 @@ <h2 id="bloom-form-title" class="bloom-form__title">Share a Bloom</h2>
id="bloom-content"
name="content"
placeholder="What's happening?"
maxlength="280"
maxlength="500"
spellcheck="true"
required
></textarea>
<div class="bloom-form__counter" data-counter>0/280</div>
<div class="bloom-form__counter" data-counter>0/500</div>
</div>

<button type="submit" data-submit class="bloom-form__submit">
Expand Down