diff --git a/.gitignore b/.gitignore index e43b0f98..a0f3a019 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,11 @@ .DS_Store +# Virtual environments +venv/ +.venv/ +env/ +.env/ +ENV/ + +# Python cache files +__pycache__/ +*.pyc diff --git a/backend/endpoints.py b/backend/endpoints.py index 0e177a07..c9d1e576 100644 --- a/backend/endpoints.py +++ b/backend/endpoints.py @@ -156,7 +156,10 @@ def send_bloom(): if type_check_error is not None: return type_check_error - user = get_current_user() + if len(request.json["content"]) > 280: + return make_response((f"Bloom too long", 422)) + + user = get_current_user() blooms.add_bloom(sender=user, content=request.json["content"]) diff --git a/front-end/components/error.mjs b/front-end/components/error.mjs index 3fc9eeee..515a4fe2 100644 --- a/front-end/components/error.mjs +++ b/front-end/components/error.mjs @@ -7,6 +7,7 @@ const _STATUS_MESSAGES = { 404: "Not Found - The requested resource does not exist.", 405: "Not Allowed - The server knows the request method, but the target resource doesn't support this method.", 418: "I'm a teapot - Server refuses to brew coffee with a teapot.", + 422: "Something is wrong with the information you filled out. Please check your inputs and try again.", 500: "Internal Server Error - Something went wrong on the server.", };