-
-
Notifications
You must be signed in to change notification settings - Fork 69
NW | 2026-mar-sdc | Zabihollah Namazi | Sprint 1 | Extralong bloom bug #239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,11 @@ | ||
| .DS_Store | ||
| # Virtual environments | ||
| venv/ | ||
| .venv/ | ||
| env/ | ||
| .env/ | ||
| ENV/ | ||
|
|
||
| # Python cache files | ||
| __pycache__/ | ||
| *.pyc |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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)) | ||
|
Comment on lines
+159
to
+160
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This fixes the bug. well done. Why not replace the magic number 280 by a named constant? |
||
|
|
||
| user = get_current_user() | ||
|
|
||
| blooms.add_bloom(sender=user, content=request.json["content"]) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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.", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the status message associated with 422 a standard status message? How did you come up with this message? |
||
| 500: "Internal Server Error - Something went wrong on the server.", | ||
| }; | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the change made in this file necessary to fix the bug?