Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Fix unicode error for PDF generation

Roland Geider8ad55911fefc
diff --git a/wger/manager/helpers.py b/wger/manager/helpers.py
index c44c1dc61..a8836c8b8 100644
--- a/wger/manager/helpers.py
+++ b/wger/manager/helpers.py
@@ -48,7 +48,7 @@ def render_workout_day(day, nr_of_weeks):
set_count = 1
day_markers.append(len(data))
- p = Paragraph('<para align="center">%(days)s: %(description)s</para>' %
+ p = Paragraph(u'<para align="center">%(days)s: %(description)s</para>' %
{'days': day['days_of_week']['text'],
'description': day['obj'].description},
styleSheet["Bold"])
diff --git a/wger/manager/views/schedule.py b/wger/manager/views/schedule.py
index 9dec8a39d..bc78b3c24 100644
--- a/wger/manager/views/schedule.py
+++ b/wger/manager/views/schedule.py
@@ -122,13 +122,13 @@ def export_pdf(request, pk, uidb64=None, token=None):
elements = []
# Set the title
- p = Paragraph('<para align="center">{0}</para>'.format(schedule), styleSheet["HeaderBold"])
+ p = Paragraph(u'<para align="center">{0}</para>'.format(schedule), styleSheet["HeaderBold"])
elements.append(p)
elements.append(Spacer(10*cm, 0.5*cm))
# Iterate through the Workout and render the training days
for step in schedule.schedulestep_set.all():
- p = Paragraph('<para>{0} {1}</para>'.format(step.duration, _('Weeks')),
+ p = Paragraph(u'<para>{0} {1}</para>'.format(step.duration, _('Weeks')),
styleSheet["HeaderBold"])
elements.append(p)
elements.append(Spacer(10*cm, 0.5*cm))