Update chat_mode.py

This commit is contained in:
whew 2021-05-13 08:11:29 +00:00 committed by GitHub
parent 53820f0bdb
commit 64b6abdf64

View file

@ -62,15 +62,12 @@ class ChatModeWeb:
) )
self.web.add_request(self.web.REQUEST_LOAD, request.path) self.web.add_request(self.web.REQUEST_LOAD, request.path)
r = make_response( return render_template(
render_template( "chat.html",
"chat.html", static_url_path=self.web.static_url_path,
static_url_path=self.web.static_url_path, username=session.get("name"),
username=session.get("name"), title=self.web.settings.get("general", "title")
title=self.web.settings.get("general", "title"),
)
) )
return self.web.add_security_headers(r)
@self.web.app.route("/update-session-username", methods=["POST"]) @self.web.app.route("/update-session-username", methods=["POST"])
def update_session_username(): def update_session_username():
@ -87,13 +84,7 @@ class ChatModeWeb:
) )
self.web.add_request(self.web.REQUEST_LOAD, request.path) self.web.add_request(self.web.REQUEST_LOAD, request.path)
r = make_response( return jsonify(username=session.get("name"), success=True)
jsonify(
username=session.get("name"),
success=True,
)
)
return self.web.add_security_headers(r)
@self.web.socketio.on("joined", namespace="/chat") @self.web.socketio.on("joined", namespace="/chat")
def joined(message): def joined(message):