From 349eff9a090da138892aaf8ef0ba5d962a2d53f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Phillip=20K=C3=BChne?= Date: Fri, 30 Jun 2023 14:50:32 +0200 Subject: [PATCH 1/2] strip whitespace from participant name in enqueue endpoint --- backend/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/app.py b/backend/app.py index 50ce785..7b117bf 100644 --- a/backend/app.py +++ b/backend/app.py @@ -37,7 +37,7 @@ def enqueue(): if not helpers.is_valid_uuid(client_id): print(request.data) abort(400) - name = request.json['name'] + name = request.json['name'].strip() song_id = request.json['id'] if request.authorization: entry_id = database.add_entry(name, song_id, client_id) From a54953ff0d69e628fce31a79b44e801b79e8b4fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Phillip=20K=C3=BChne?= Date: Fri, 30 Jun 2023 15:28:46 +0200 Subject: [PATCH 2/2] fix copy functionality Fixed copy functionality by no longer rendering the data into the function call as string literal, but instead accessing it from the DOM in the function call. --- backend/templates/main_admin.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/backend/templates/main_admin.html b/backend/templates/main_admin.html index ac98b48..4649063 100644 --- a/backend/templates/main_admin.html +++ b/backend/templates/main_admin.html @@ -187,15 +187,16 @@ function TableActions(value, row, index) { let outerHTML = "" if (row.Transferred == 1) { - outerHTML = "  "; + outerHTML = "  "; } else { - outerHTML = "  "; + outerHTML = "  "; } return outerHTML; } function CopyFormatter(value, row, index) { - return ""+value+""; + let escapedString = value.replace("\"","\\\"").replace("\'", "\\\'") + return ""+value+""; } function getIdSelections() {