summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--app/static/js/record.js2
-rw-r--r--app/templates/workout/record.html2
-rwxr-xr-xtools/excel_import.py3
4 files changed, 6 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index c7e9428..ff893bb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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 (?, ?, ?)",
(