Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Check if the workout has at least one training day

Roland Geider1514eca8e46a
diff --git a/manager/pdf.py b/manager/pdf.py
index e6b8c7b8a..f46e77c26 100644
--- a/manager/pdf.py
+++ b/manager/pdf.py
@@ -252,15 +252,22 @@ def workout_log(request, id):
# Set the table data
- t = Table(data, colwidths, rowheights, style = table_style)
-
- # Manually set the width of the columns
- for i in range(first_weight_column, nr_of_weeks + first_weight_column):
- t._argW[i] = 1.8 * cm # Columns for entering the log
+ if data:
+ logger.debug(data)
+ t = Table(data, colwidths, rowheights, style = table_style)
+
+ # Manually set the width of the columns
+ for i in range(first_weight_column, nr_of_weeks + first_weight_column):
+ t._argW[i] = 1.8 * cm # Columns for entering the log
+
+ t._argW[0] = 0.6 * cm # Exercise numbering
+ t._argW[1] = 3.5 * cm # Name of exercise
+ t._argW[2] = 1.9 * cm # Repetitions
- t._argW[0] = 0.6 * cm # Exercise numbering
- t._argW[1] = 3.5 * cm # Name of exercise
- t._argW[2] = 1.9 * cm # Repetitions
+ # There is nothing to output
+ else:
+ t = Paragraph(_('<i>This is an empty workout, what did you expect on the PDF?</i>'),
+ styleSheet["Normal"])
#
# Add all elements to the document