Skip to content
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

🪲 Always return empty JSON object on successful response, fixes #6160 #6161

Merged
merged 2 commits into from
Feb 6, 2025
Merged
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
4 changes: 2 additions & 2 deletions website/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def mark_as_teacher(self, username_teacher):

update_is_teacher(self.db, teacher, is_teacher_value)

return make_response('', 200)
return make_response({}, 200)

@route("/mark-super-teacher/<username_teacher>", methods=["POST"])
@requires_admin
Expand Down Expand Up @@ -231,7 +231,7 @@ def change_user_email(self, user):
)
except BaseException:
return make_response(gettext("mail_error_change_processed"), 400)
return make_response('', 200)
return make_response({}, 200)

@route("/getUserTags", methods=["POST"])
@requires_admin
Expand Down
2 changes: 1 addition & 1 deletion website/auth_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ def store_new_account(self, account, email):
)
except BaseException:
return user, make_response({gettext("mail_error_change_processed")}, 400)
resp = make_response('', 200)
resp = make_response({}, 200)
return user, resp

@route('/public_profile', methods=['POST'])
Expand Down
6 changes: 3 additions & 3 deletions website/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def join_class(self):
# Also remove the pending message in this case
session["messages"] = session["messages"] - 1 if session["messages"] else 0

return make_response('', 200)
return make_response({}, 200)

@route("/<class_id>/student/<student_id>", methods=["DELETE"])
@requires_login
Expand All @@ -187,7 +187,7 @@ def leave_class(self, user, class_id, student_id):

self.db.remove_student_from_class(Class["id"], student_id)
refresh_current_user_from_db()
return make_response('', 200)
return make_response({}, 200)

@route("/<class_id>/second-teacher/<second_teacher>", methods=["DELETE"])
@requires_login
Expand All @@ -199,7 +199,7 @@ def remove_second_teacher(self, user, class_id, second_teacher):
self.db.remove_second_teacher_from_class(Class, second_teacher)

refresh_current_user_from_db()
return make_response('', 200)
return make_response({}, 200)


class MiscClassPages(WebsiteModule):
Expand Down
2 changes: 1 addition & 1 deletion website/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,4 @@ def delete_tag(self, user, tag):
for adventure in db_tag['tagged_in']:
self.db.delete_tag_from_adventure(tag, adventure['id'])

return make_response('', 200)
return make_response({}, 200)