diff options
| author | stilbruch <stilbruch@protonmail.com> | 2022-05-16 15:03:48 -0500 |
|---|---|---|
| committer | stilbruch <stilbruch@protonmail.com> | 2022-05-16 15:03:48 -0500 |
| commit | d2c0dcf06d632389d2c451b1d9d37735291d7e62 (patch) | |
| tree | a1676dc06867caa17b94f8c7999451685c22096a | |
| parent | bbb9ecc9810a8d4a68f5400317fde266412fc8ac (diff) | |
| download | Strengthy-d2c0dcf06d632389d2c451b1d9d37735291d7e62.tar.xz Strengthy-d2c0dcf06d632389d2c451b1d9d37735291d7e62.zip | |
Fix record.js checking bug
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | app/static/js/record.js | 2 | ||||
| -rw-r--r-- | app/templates/workout/record.html | 2 | ||||
| -rwxr-xr-x | tools/excel_import.py | 3 |
4 files changed, 6 insertions, 2 deletions
@@ -1,4 +1,5 @@ __pycache__/ *.db +*.bak *.xlsx diff --git a/app/static/js/record.js b/app/static/js/record.js index a855ea4..2e99766 100644 --- a/app/static/js/record.js +++ b/app/static/js/record.js @@ -236,7 +236,7 @@ function onKeyDown(event) { if (!targetNode.parentElement.parentElement.isEqualNode(currentNode.parentElement.parentElement)) { // going to new row - if (currentNode.value != "" && allInputs[currentIndex - 1].value && allINputs[currentIndex - 1] != "") { + if (currentNode.value != "" && allInputs[currentIndex - 1].value && allInputs[currentIndex - 1] != "") { onClickSetCheck(currentNode.parentElement.parentElement.children[3].children[0]); } } diff --git a/app/templates/workout/record.html b/app/templates/workout/record.html index 53b2788..1cfeda1 100644 --- a/app/templates/workout/record.html +++ b/app/templates/workout/record.html @@ -42,7 +42,7 @@ </div> </td> {% else %} - <td>{{ set['lbs'](class_='input', onkeydown='onKeyDown(event)') }}</td> + <td>{{ set['lbs'](class_='input', type='number', onkeydown='onKeyDown(event)') }}</td> <td>{{ set['units'](class_='input', onkeydown='onKeyDown(event)') }}</td> {% endif %} <td> diff --git a/tools/excel_import.py b/tools/excel_import.py index 680c2fa..49e25ba 100755 --- a/tools/excel_import.py +++ b/tools/excel_import.py @@ -64,6 +64,9 @@ exercise_ids = {} def insert_workout(cur, workout): + if len(workout["sets"]) == 0: + return + cur.execute( "INSERT INTO workout_records(finished, user_id, workout_id) VALUES (?, ?, ?)", ( |
