Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Remove the 'u' from strings, everything is unicode

Roland Geider3e309b3a5d23
diff --git a/docs/conf.py b/docs/conf.py
index f6374037f..2f2fd6afd 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -47,8 +47,8 @@ source_suffix = '.rst'
master_doc = 'index'
# General information about the project.
-project = u'wger Workout Manager'
-copyright = u'2020, Roland Geider'
+project = 'wger Workout Manager'
+copyright = '2020, Roland Geider'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
@@ -200,8 +200,8 @@ latex_elements = {
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
- ('index', 'wgerWorkoutManager.tex', u'wger Workout Manager Documentation',
- u'Roland Geider', 'manual'),
+ ('index', 'wgerWorkoutManager.tex', 'wger Workout Manager Documentation',
+ 'Roland Geider', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
@@ -230,8 +230,8 @@ latex_documents = [
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
- ('index', 'wgerworkoutmanager', u'wger Workout Manager Documentation',
- [u'Roland Geider'], 1)
+ ('index', 'wgerworkoutmanager', 'wger Workout Manager Documentation',
+ ['Roland Geider'], 1)
]
# If true, show URL addresses after external links.
@@ -244,8 +244,8 @@ man_pages = [
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
- ('index', 'wgerWorkoutManager', u'wger Workout Manager Documentation',
- u'Roland Geider', 'wgerWorkoutManager', 'One line description of project.',
+ ('index', 'wgerWorkoutManager', 'wger Workout Manager Documentation',
+ 'Roland Geider', 'wgerWorkoutManager', 'One line description of project.',
'Miscellaneous'),
]
diff --git a/wger/config/models.py b/wger/config/models.py
index 309852379..cf6a30947 100644
--- a/wger/config/models.py
+++ b/wger/config/models.py
@@ -78,7 +78,7 @@ class LanguageConfig(models.Model):
"""
Return a more human-readable representation
"""
- return u"Config for language {0}".format(self.language)
+ return "Config for language {0}".format(self.language)
def save(self, *args, **kwargs):
"""
@@ -134,7 +134,7 @@ class GymConfig(models.Model):
"""
Return a more human-readable representation
"""
- return u"Default gym {0}".format(self.default_gym)
+ return "Default gym {0}".format(self.default_gym)
def save(self, *args, **kwargs):
"""
diff --git a/wger/core/models.py b/wger/core/models.py
index 37a2b21f3..9373e5f8d 100644
--- a/wger/core/models.py
+++ b/wger/core/models.py
@@ -63,7 +63,7 @@ class Language(models.Model):
"""
Return a more human-readable representation
"""
- return u"{0} ({1})".format(self.full_name, self.short_name)
+ return "{0} ({1})".format(self.full_name, self.short_name)
def get_absolute_url(self):
"""
@@ -382,7 +382,7 @@ by the US Department of Agriculture. It is extremely complete, with around
"""
Return a more human-readable representation
"""
- return u"Profile for user {0}".format(self.user)
+ return "Profile for user {0}".format(self.user)
@property
def use_metric(self):
@@ -521,7 +521,7 @@ class UserCache(models.Model):
"""
Return a more human-readable representation
"""
- return u"Cache for user {0}".format(self.user)
+ return "Cache for user {0}".format(self.user)
class DaysOfWeek(models.Model):
@@ -582,7 +582,7 @@ class License(models.Model):
"""
Return a more human-readable representation
"""
- return u"{0} ({1})".format(self.full_name, self.short_name)
+ return "{0} ({1})".format(self.full_name, self.short_name)
#
# Own methods
diff --git a/wger/core/templates/index.html b/wger/core/templates/index.html
index f59c8569a..cc25f5d27 100644
--- a/wger/core/templates/index.html
+++ b/wger/core/templates/index.html
@@ -101,9 +101,9 @@ day in your current workout:{% endblocktrans %} <strong>{{current_workout}}</str
{% endif %}
</a>
</p>
- <p>
- – {{ current_workout.creation_date }}
- <p>
+ <p>
+ – {{ current_workout.creation_date }}
+ <p>
{% endif %}
<table class="table table-hover table-sm">
diff --git a/wger/core/views/languages.py b/wger/core/views/languages.py
index fdc1a7970..787ce346c 100644
--- a/wger/core/views/languages.py
+++ b/wger/core/views/languages.py
@@ -90,7 +90,7 @@ class LanguageDeleteView(WgerDeleteMixin, LoginRequiredMixin, PermissionRequired
Send some additional data to the template
"""
context = super(LanguageDeleteView, self).get_context_data(**kwargs)
- context['title'] = _(u'Delete {0}?').format(self.object.full_name)
+ context['title'] = _('Delete {0}?').format(self.object.full_name)
return context
@@ -108,5 +108,5 @@ class LanguageEditView(WgerFormMixin, LoginRequiredMixin, PermissionRequiredMixi
Send some additional data to the template
"""
context = super(LanguageEditView, self).get_context_data(**kwargs)
- context['title'] = _(u'Edit {0}').format(self.object.full_name)
+ context['title'] = _('Edit {0}').format(self.object.full_name)
return context
diff --git a/wger/core/views/license.py b/wger/core/views/license.py
index 62607b357..613578fb7 100644
--- a/wger/core/views/license.py
+++ b/wger/core/views/license.py
@@ -81,7 +81,7 @@ class LicenseUpdateView(WgerFormMixin, LoginRequiredMixin, PermissionRequiredMix
Send some additional data to the template
"""
context = super(LicenseUpdateView, self).get_context_data(**kwargs)
- context['title'] = _(u'Edit {0}').format(self.object)
+ context['title'] = _('Edit {0}').format(self.object)
return context
@@ -100,5 +100,5 @@ class LicenseDeleteView(WgerDeleteMixin, LoginRequiredMixin, PermissionRequiredM
Send some additional data to the template
"""
context = super(LicenseDeleteView, self).get_context_data(**kwargs)
- context['title'] = _(u'Delete {0}?').format(self.object)
+ context['title'] = _('Delete {0}?').format(self.object)
return context
diff --git a/wger/core/views/repetition_units.py b/wger/core/views/repetition_units.py
index 5940e6127..dc6735a69 100644
--- a/wger/core/views/repetition_units.py
+++ b/wger/core/views/repetition_units.py
@@ -82,7 +82,7 @@ class UpdateView(WgerFormMixin, LoginRequiredMixin, PermissionRequiredMixin, Upd
Send some additional data to the template
"""
context = super(UpdateView, self).get_context_data(**kwargs)
- context['title'] = _(u'Edit {0}').format(self.object)
+ context['title'] = _('Edit {0}').format(self.object)
return context
@@ -111,5 +111,5 @@ class DeleteView(WgerDeleteMixin, LoginRequiredMixin, PermissionRequiredMixin, D
Send some additional data to the template
"""
context = super(DeleteView, self).get_context_data(**kwargs)
- context['title'] = _(u'Delete {0}?').format(self.object)
+ context['title'] = _('Delete {0}?').format(self.object)
return context
diff --git a/wger/core/views/weight_units.py b/wger/core/views/weight_units.py
index 191ca578a..14821923e 100644
--- a/wger/core/views/weight_units.py
+++ b/wger/core/views/weight_units.py
@@ -82,7 +82,7 @@ class UpdateView(WgerFormMixin, LoginRequiredMixin, PermissionRequiredMixin, Upd
Send some additional data to the template
"""
context = super(UpdateView, self).get_context_data(**kwargs)
- context['title'] = _(u'Edit {0}').format(self.object)
+ context['title'] = _('Edit {0}').format(self.object)
return context
@@ -111,5 +111,5 @@ class DeleteView(WgerDeleteMixin, LoginRequiredMixin, PermissionRequiredMixin, D
Send some additional data to the template
"""
context = super(DeleteView, self).get_context_data(**kwargs)
- context['title'] = _(u'Delete {0}?').format(self.object)
+ context['title'] = _('Delete {0}?').format(self.object)
return context
diff --git a/wger/exercises/management/commands/download-exercise-images.py b/wger/exercises/management/commands/download-exercise-images.py
index 9fa985539..607853582 100644
--- a/wger/exercises/management/commands/download-exercise-images.py
+++ b/wger/exercises/management/commands/download-exercise-images.py
@@ -93,9 +93,9 @@ class Command(BaseCommand):
exercise_id = exercise_json['id']
self.stdout.write('')
- self.stdout.write(u"*** Processing {0} (ID: {1}, UUID: {2})".format(exercise_name,
- exercise_id,
- exercise_uuid))
+ self.stdout.write("*** Processing {0} (ID: {1}, UUID: {2})".format(exercise_name,
+ exercise_id,
+ exercise_uuid))
try:
exercise = Exercise.objects.get(uuid=exercise_uuid)
diff --git a/wger/exercises/migrations/0003_auto_20160921_2000.py b/wger/exercises/migrations/0003_auto_20160921_2000.py
index a43a8e359..7200060b2 100644
--- a/wger/exercises/migrations/0003_auto_20160921_2000.py
+++ b/wger/exercises/migrations/0003_auto_20160921_2000.py
@@ -26,7 +26,7 @@ def capitalize_name(apps, schema_editor):
def capitalize(input):
out = []
for word in input.split(' '):
- if len(word) > 2 and word[0] != u'ß':
+ if len(word) > 2 and word[0] != 'ß':
out.append(word[:1].upper() + word[1:])
else:
out.append(word)
diff --git a/wger/exercises/models.py b/wger/exercises/models.py
index 730262463..b0fe5933e 100644
--- a/wger/exercises/models.py
+++ b/wger/exercises/models.py
@@ -328,7 +328,7 @@ class Exercise(AbstractSubmissionModel, AbstractLicenseModel, models.Model):
self.license_author = request.user.username
subject = _('New user submitted exercise')
- message = _(u'The user {0} submitted a new exercise "{1}".').format(
+ message = _('The user {0} submitted a new exercise "{1}".').format(
request.user.username, self.name)
mail.mail_admins(str(subject),
str(message),
@@ -448,7 +448,7 @@ class ExerciseImage(AbstractSubmissionModel, AbstractLicenseModel, models.Model)
self.license_author = request.user.username
subject = _('New user submitted image')
- message = _(u'The user {0} submitted a new image "{1}" for exercise {2}.').format(
+ message = _('The user {0} submitted a new image "{1}" for exercise {2}.').format(
request.user.username,
self.name,
self.exercise)
diff --git a/wger/exercises/views/categories.py b/wger/exercises/views/categories.py
index 64b759c77..d7062b916 100644
--- a/wger/exercises/views/categories.py
+++ b/wger/exercises/views/categories.py
@@ -90,7 +90,7 @@ class ExerciseCategoryUpdateView(WgerFormMixin,
# Send some additional data to the template
def get_context_data(self, **kwargs):
context = super(ExerciseCategoryUpdateView, self).get_context_data(**kwargs)
- context['title'] = _(u'Edit {0}').format(self.object.name)
+ context['title'] = _('Edit {0}').format(self.object.name)
return context
@@ -118,5 +118,5 @@ class ExerciseCategoryDeleteView(WgerDeleteMixin,
# Send some additional data to the template
def get_context_data(self, **kwargs):
context = super(ExerciseCategoryDeleteView, self).get_context_data(**kwargs)
- context['title'] = _(u'Delete {0}?').format(self.object.name)
+ context['title'] = _('Delete {0}?').format(self.object.name)
return context
diff --git a/wger/exercises/views/exercises.py b/wger/exercises/views/exercises.py
index 0a8c97a35..64c7aacae 100644
--- a/wger/exercises/views/exercises.py
+++ b/wger/exercises/views/exercises.py
@@ -237,7 +237,7 @@ class ExerciseUpdateView(ExercisesEditAddView,
def get_context_data(self, **kwargs):
context = super(ExerciseUpdateView, self).get_context_data(**kwargs)
- context['title'] = _(u'Edit {0}').format(self.object.name)
+ context['title'] = _('Edit {0}').format(self.object.name)
return context
@@ -283,7 +283,7 @@ class ExerciseCorrectView(ExercisesEditAddView, LoginRequiredMixin, UpdateView):
def get_context_data(self, **kwargs):
context = super(ExerciseCorrectView, self).get_context_data(**kwargs)
- context['title'] = _(u'Correct {0}').format(self.object.name)
+ context['title'] = _('Correct {0}').format(self.object.name)
return context
def form_valid(self, form):
@@ -334,7 +334,7 @@ class ExerciseDeleteView(WgerDeleteMixin,
Send some additional data to the template
"""
context = super(ExerciseDeleteView, self).get_context_data(**kwargs)
- context['title'] = _(u'Delete {0}?').format(self.object.name)
+ context['title'] = _('Delete {0}?').format(self.object.name)
return context
diff --git a/wger/exercises/views/muscles.py b/wger/exercises/views/muscles.py
index bf246a514..d16401419 100644
--- a/wger/exercises/views/muscles.py
+++ b/wger/exercises/views/muscles.py
@@ -102,7 +102,7 @@ class MuscleUpdateView(WgerFormMixin, LoginRequiredMixin, PermissionRequiredMixi
Send some additional data to the template
"""
context = super(MuscleUpdateView, self).get_context_data(**kwargs)
- context['title'] = _(u'Edit {0}').format(self.object.name)
+ context['title'] = _('Edit {0}').format(self.object.name)
return context
@@ -122,5 +122,5 @@ class MuscleDeleteView(WgerDeleteMixin, LoginRequiredMixin, PermissionRequiredMi
Send some additional data to the template
"""
context = super(MuscleDeleteView, self).get_context_data(**kwargs)
- context['title'] = _(u'Delete {0}?').format(self.object.name)
+ context['title'] = _('Delete {0}?').format(self.object.name)
return context
diff --git a/wger/gym/models.py b/wger/gym/models.py
index 35fba7e32..028b40cea 100644
--- a/wger/gym/models.py
+++ b/wger/gym/models.py
@@ -70,19 +70,19 @@ class Gym(m.Model):
null=True)
"""Gym owner"""
- zip_code = m.CharField(_(u'ZIP code'),
+ zip_code = m.CharField(_('ZIP code'),
max_length=10,
blank=True,
null=True)
"""ZIP code"""
- city = m.CharField(_(u'City'),
+ city = m.CharField(_('City'),
max_length=30,
blank=True,
null=True)
"""City"""
- street = m.CharField(_(u'Street'),
+ street = m.CharField(_('Street'),
max_length=30,
blank=True,
null=True)
@@ -139,7 +139,7 @@ class GymConfig(m.Model):
"""
Return a more human-readable representation
"""
- return ugettext(u'Configuration for {}'.format(self.gym.name))
+ return ugettext('Configuration for {}'.format(self.gym.name))
def get_owner_object(self):
"""
@@ -401,7 +401,7 @@ class ContractType(m.Model):
"""
Return a more human-readable representation
"""
- return u"{}".format(self.name)
+ return "{}".format(self.name)
def get_owner_object(self):
"""
@@ -450,7 +450,7 @@ class ContractOption(m.Model):
"""
Return a more human-readable representation
"""
- return u"{}".format(self.name)
+ return "{}".format(self.name)
def get_owner_object(self):
"""
@@ -571,19 +571,19 @@ class Contract(m.Model):
null=True)
"""The member's email"""
- zip_code = m.CharField(_(u'ZIP code'),
+ zip_code = m.CharField(_('ZIP code'),
max_length=10,
blank=True,
null=True)
"""ZIP code"""
- city = m.CharField(_(u'City'),
+ city = m.CharField(_('City'),
max_length=30,
blank=True,
null=True)
"""City"""
- street = m.CharField(_(u'Street'),
+ street = m.CharField(_('Street'),
max_length=30,
blank=True,
null=True)
diff --git a/wger/gym/views/admin_notes.py b/wger/gym/views/admin_notes.py
index 694f387f8..9a651e973 100644
--- a/wger/gym/views/admin_notes.py
+++ b/wger/gym/views/admin_notes.py
@@ -158,7 +158,7 @@ class UpdateView(WgerFormMixin, LoginRequiredMixin, PermissionRequiredMixin, Upd
Send some additional data to the template
"""
context = super(UpdateView, self).get_context_data(**kwargs)
- context['title'] = _(u'Edit {0}').format(self.object)
+ context['title'] = _('Edit {0}').format(self.object)
return context
@@ -194,5 +194,5 @@ class DeleteView(WgerDeleteMixin, LoginRequiredMixin, PermissionRequiredMixin, D
Send some additional data to the template
"""
context = super(DeleteView, self).get_context_data(**kwargs)
- context['title'] = _(u'Delete {0}?').format(self.object)
+ context['title'] = _('Delete {0}?').format(self.object)
return context
diff --git a/wger/gym/views/config.py b/wger/gym/views/config.py
index 4d63f163f..ab2d2fa31 100644
--- a/wger/gym/views/config.py
+++ b/wger/gym/views/config.py
@@ -65,5 +65,5 @@ class GymConfigUpdateView(WgerFormMixin, LoginRequiredMixin, PermissionRequiredM
Send some additional data to the template
"""
context = super(GymConfigUpdateView, self).get_context_data(**kwargs)
- context['title'] = _(u'Edit {0}').format(self.object)
+ context['title'] = _('Edit {0}').format(self.object)
return context
diff --git a/wger/gym/views/contract.py b/wger/gym/views/contract.py
index fe623fdde..b21fc3cdb 100644
--- a/wger/gym/views/contract.py
+++ b/wger/gym/views/contract.py
@@ -151,7 +151,7 @@ class UpdateView(WgerFormMixin, LoginRequiredMixin, PermissionRequiredMixin, Upd
Send some additional data to the template
"""
context = super(UpdateView, self).get_context_data(**kwargs)
- context['title'] = _(u'Edit {0}').format(self.object)
+ context['title'] = _('Edit {0}').format(self.object)
return context
diff --git a/wger/gym/views/contract_option.py b/wger/gym/views/contract_option.py
index 997e3a0d7..1c48f5813 100644
--- a/wger/gym/views/contract_option.py
+++ b/wger/gym/views/contract_option.py
@@ -120,7 +120,7 @@ class UpdateView(WgerFormMixin, LoginRequiredMixin, PermissionRequiredMixin, Upd
Send some additional data to the template
"""
context = super(UpdateView, self).get_context_data(**kwargs)
- context['title'] = _(u'Edit {0}').format(self.object)
+ context['title'] = _('Edit {0}').format(self.object)
return context
@@ -157,7 +157,7 @@ class DeleteView(WgerDeleteMixin, LoginRequiredMixin, PermissionRequiredMixin, D
Send some additional data to the template
"""
context = super(DeleteView, self).get_context_data(**kwargs)
- context['title'] = _(u'Delete {0}').format(self.object)
+ context['title'] = _('Delete {0}').format(self.object)
return context
diff --git a/wger/gym/views/contract_type.py b/wger/gym/views/contract_type.py
index d135085f8..8b84b1ffe 100644
--- a/wger/gym/views/contract_type.py
+++ b/wger/gym/views/contract_type.py
@@ -120,7 +120,7 @@ class UpdateView(WgerFormMixin, LoginRequiredMixin, PermissionRequiredMixin, Upd
Send some additional data to the template
"""
context = super(UpdateView, self).get_context_data(**kwargs)
- context['title'] = _(u'Edit {0}').format(self.object)
+ context['title'] = _('Edit {0}').format(self.object)
return context
@@ -157,7 +157,7 @@ class DeleteView(WgerDeleteMixin, LoginRequiredMixin, PermissionRequiredMixin, D
Send some additional data to the template
"""
context = super(DeleteView, self).get_context_data(**kwargs)
- context['title'] = _(u'Delete {0}').format(self.object)
+ context['title'] = _('Delete {0}').format(self.object)
return context
diff --git a/wger/gym/views/document.py b/wger/gym/views/document.py
index f53f1e23e..ac70f48c5 100644
--- a/wger/gym/views/document.py
+++ b/wger/gym/views/document.py
@@ -168,7 +168,7 @@ class UpdateView(WgerFormMixin, LoginRequiredMixin, PermissionRequiredMixin, Upd
Send some additional data to the template
"""
context = super(UpdateView, self).get_context_data(**kwargs)
- context['title'] = _(u'Edit {0}').format(self.object)
+ context['title'] = _('Edit {0}').format(self.object)
return context
@@ -204,5 +204,5 @@ class DeleteView(WgerDeleteMixin, LoginRequiredMixin, PermissionRequiredMixin, D
Send some additional data to the template
"""
context = super(DeleteView, self).get_context_data(**kwargs)
- context['title'] = _(u'Delete {0}?').format(self.object)
+ context['title'] = _('Delete {0}?').format(self.object)
return context
diff --git a/wger/gym/views/gym.py b/wger/gym/views/gym.py
index 27b14a8df..4c6b56acb 100644
--- a/wger/gym/views/gym.py
+++ b/wger/gym/views/gym.py
@@ -445,7 +445,7 @@ class GymUpdateView(WgerFormMixin, LoginRequiredMixin, PermissionRequiredMixin,
Send some additional data to the template
"""
context = super(GymUpdateView, self).get_context_data(**kwargs)
- context['title'] = _(u'Edit {0}').format(self.object)
+ context['title'] = _('Edit {0}').format(self.object)
return context
@@ -470,5 +470,5 @@ class GymDeleteView(WgerDeleteMixin, LoginRequiredMixin, PermissionRequiredMixin
Send some additional data to the template
"""
context = super(GymDeleteView, self).get_context_data(**kwargs)
- context['title'] = _(u'Delete {0}?').format(self.object)
+ context['title'] = _('Delete {0}?').format(self.object)
return context
diff --git a/wger/manager/forms.py b/wger/manager/forms.py
index 9d92ed255..55f39af97 100644
--- a/wger/manager/forms.py
+++ b/wger/manager/forms.py
@@ -209,7 +209,7 @@ class WorkoutScheduleDownloadForm(Form):
Form for the workout schedule download
"""
pdf_type = ChoiceField(
- label=ugettext_lazy(u"Type"),
+ label=ugettext_lazy("Type"),
choices=(("log", ugettext_lazy("Log")),
("table", ugettext_lazy("Table")))
)
diff --git a/wger/manager/helpers.py b/wger/manager/helpers.py
index 33ff2d415..2bba72491 100644
--- a/wger/manager/helpers.py
+++ b/wger/manager/helpers.py
@@ -73,7 +73,7 @@ def render_workout_day(day, nr_of_weeks=7, images=False, comments=False, only_ta
set_count = 1
day_markers.append(len(data))
- p = Paragraph(u'<para align="center">%(days)s: %(description)s</para>' %
+ p = Paragraph('<para align="center">%(days)s: %(description)s</para>' %
{'days': day['days_of_week']['text'],
'description': day['obj'].description},
styleSheet["SubHeader"])
@@ -97,7 +97,7 @@ def render_workout_day(day, nr_of_weeks=7, images=False, comments=False, only_ta
# Process the settings
if exercise['has_weight']:
setting_out = []
- for i in exercise['setting_text'].split(u'–'):
+ for i in exercise['setting_text'].split('–'):
setting_out.append(Paragraph(i, styleSheet["Small"], bulletText=''))
else:
setting_out = Paragraph(exercise['setting_text'], styleSheet["Small"])
@@ -214,7 +214,7 @@ def reps_smart_text(settings, set_obj):
if setting.repetition_unit_id != 2:
reps = "{0} {1}".format(setting.reps, rep_unit).strip()
else:
- reps = u'∞'
+ reps = '∞'
return reps
def get_weight_unit_reprentation(setting):
@@ -259,8 +259,8 @@ def reps_smart_text(settings, set_obj):
weight_unit = settings[0].weight_unit
weight = normalize_weight(settings[0])
- setting_text = u'{0} × {1}'.format(set_obj.sets, reps).strip()
- setting_list_text = u'{0} {1}'.format(reps, rep_unit).strip()
+ setting_text = '{0} × {1}'.format(set_obj.sets, reps).strip()
+ setting_list_text = '{0} {1}'.format(reps, rep_unit).strip()
if weight:
setting_text += ' ({0} {1})'.format(weight, weight_unit)
setting_list_text += ' ({0} {1})'.format(weight, weight_unit)
@@ -293,7 +293,7 @@ def reps_smart_text(settings, set_obj):
tmp_repetition_unit.append(setting.repetition_unit)
tmp_weight_unit.append(setting.weight_unit)
- setting_text = u' – '.join(tmp_reps_text)
+ setting_text = ' – '.join(tmp_reps_text)
setting_list = tmp_reps_text
repetition_units = tmp_repetition_unit
weight_units = tmp_weight_unit
diff --git a/wger/manager/models.py b/wger/manager/models.py
index c3402c915..654cb773f 100644
--- a/wger/manager/models.py
+++ b/wger/manager/models.py
@@ -89,9 +89,9 @@ class Workout(models.Model):
Return a more human-readable representation
"""
if self.comment:
- return u"{0}".format(self.comment)
+ return "{0}".format(self.comment)
else:
- return u"{0} ({1})".format(_('Workout'), self.creation_date)
+ return "{0} ({1})".format(_('Workout'), self.creation_date)
def save(self, *args, **kwargs):
"""
@@ -538,7 +538,7 @@ class Day(models.Model):
return {'obj': self,
'days_of_week': {
- 'text': u', '.join([str(_(i.day_of_week))
+ 'text': ', '.join([str(_(i.day_of_week))
for i in tmp_days_of_week]),
'day_list': tmp_days_of_week},
'muscles': {
@@ -577,7 +577,7 @@ class Set(models.Model):
"""
Return a more human-readable representation
"""
- return u"Set-ID {0}".format(self.id)
+ return "Set-ID {0}".format(self.id)
def get_owner_object(self):
"""
@@ -658,7 +658,7 @@ class Setting(models.Model):
"""
Return a more human-readable representation
"""
- return u"settings for exercise {0} in set {1}".format(self.exercise.id, self.set.id)
+ return "settings for exercise {0} in set {1}".format(self.exercise.id, self.set.id)
def save(self, *args, **kwargs):
"""
@@ -743,9 +743,9 @@ class WorkoutLog(models.Model):
"""
Return a more human-readable representation
"""
- return u"Log entry: {0} - {1} kg on {2}".format(self.reps,
- self.weight,
- self.date)
+ return "Log entry: {0} - {1} kg on {2}".format(self.reps,
+ self.weight,
+ self.date)
def get_owner_object(self):
"""
@@ -861,7 +861,7 @@ class WorkoutSession(models.Model):
"""
Return a more human-readable representation
"""
- return u"{0} - {1}".format(self.workout, self.date)
+ return "{0} - {1}".format(self.workout, self.date)
class Meta:
"""
diff --git a/wger/manager/tests/test_workout.py b/wger/manager/tests/test_workout.py
index e56acbaed..217cac9c8 100644
--- a/wger/manager/tests/test_workout.py
+++ b/wger/manager/tests/test_workout.py
@@ -190,10 +190,10 @@ class WorkoutModelTestCase(WgerTestCase):
workout = Workout()
workout.creation_date = datetime.date.today()
self.assertEqual('{0}'.format(workout),
- '{0} ({1})'.format(u'Workout', datetime.date.today()))
+ '{0} ({1})'.format('Workout', datetime.date.today()))
- workout.comment = u'my description'
- self.assertEqual('{0}'.format(workout), u'my description')
+ workout.comment = 'my description'
+ self.assertEqual('{0}'.format(workout), 'my description')
class WorkoutApiTestCase(api_base_test.ApiBaseResourceTestCase):
diff --git a/wger/manager/tests/test_workout_canonical.py b/wger/manager/tests/test_workout_canonical.py
index b94a4905a..aadf0a1d8 100644
--- a/wger/manager/tests/test_workout_canonical.py
+++ b/wger/manager/tests/test_workout_canonical.py
@@ -64,20 +64,20 @@ class WorkoutCanonicalFormTestCase(WgerTestCase):
self.assertEqual(workout.canonical_representation['obj'], workout)
canonical_form = {'days_of_week': {'day_list': [DaysOfWeek.objects.get(pk=2)],
- 'text': u'Tuesday'},
+ 'text': 'Tuesday'},
'muscles': {'back': [muscle2],
'frontsecondary': [],
'backsecondary': [],
'front': [muscle1]},
'obj': Day.objects.get(pk=1),
'set_list': [{'exercise_list': [{'obj': Exercise.objects.get(pk=1),
- 'comment_list': [u'test 123'],
+ 'comment_list': ['test 123'],
'has_weight': False,
- 'setting_list': [u'8', u'8'],
+ 'setting_list': ['8', '8'],
'reps_list': [8, 8],
'weight_list': [None, None],
'setting_obj_list': [setting_1],
- 'setting_text': u'2 \xd7 8',
+ 'setting_text': '2 \xd7 8',
'repetition_units': [repetition_unit,
repetition_unit],
'weight_units': [weight_unit,
@@ -92,23 +92,23 @@ class WorkoutCanonicalFormTestCase(WgerTestCase):
self.assertEqual(workout.canonical_representation['day_list'][0], canonical_form)
canonical_form = {'days_of_week': {'day_list': [DaysOfWeek.objects.get(pk=4)],
- 'text': u'Thursday'},
+ 'text': 'Thursday'},
'obj': Day.objects.get(pk=2),
'muscles': {'back': [muscle2],
'frontsecondary': [muscle1],
'backsecondary': [muscle1],
'front': []},
'set_list': [{'exercise_list': [{'obj': Exercise.objects.get(pk=2),
- 'comment_list': [u'Foobar'],
+ 'comment_list': ['Foobar'],
'has_weight': True,
'reps_list': [10, 10, 10, 10],
- 'setting_list': [u'10 (15 kg)',
- u'10 (15 kg)',
- u'10 (15 kg)',
- u'10 (15 kg)'],
+ 'setting_list': ['10 (15 kg)',
+ '10 (15 kg)',
+ '10 (15 kg)',
+ '10 (15 kg)'],
'weight_list': [Decimal(15)] * 4,
'setting_obj_list': [setting_2],
- 'setting_text': u'4 \xd7 10 (15 kg)',
+ 'setting_text': '4 \xd7 10 (15 kg)',
'repetition_units': [repetition_unit,
repetition_unit,
repetition_unit,
@@ -127,7 +127,7 @@ class WorkoutCanonicalFormTestCase(WgerTestCase):
self.assertEqual(workout.canonical_representation['day_list'][1], canonical_form)
canonical_form = {'days_of_week': {'day_list': [DaysOfWeek.objects.get(pk=5)],
- 'text': u'Friday'},
+ 'text': 'Friday'},
'obj': Day.objects.get(pk=4),
'muscles': {'back': [],
'front': [],
@@ -149,7 +149,7 @@ class WorkoutCanonicalFormTestCase(WgerTestCase):
muscle1 = Muscle.objects.get(pk=1)
muscle2 = Muscle.objects.get(pk=2)
self.assertEqual(day.canonical_representation['days_of_week'],
- {'day_list': [weekday1, weekday2], 'text': u'Wednesday, Friday'})
+ {'day_list': [weekday1, weekday2], 'text': 'Wednesday, Friday'})
self.assertEqual(day.canonical_representation['muscles'],
{'back': [muscle2],
'frontsecondary': [muscle1],
@@ -158,13 +158,13 @@ class WorkoutCanonicalFormTestCase(WgerTestCase):
self.assertEqual(day.canonical_representation['obj'], day)
canonical_form = [{'exercise_list': [{'obj': Exercise.objects.get(pk=2),
- 'comment_list': [u'Foobar'],
+ 'comment_list': ['Foobar'],
'reps_list': [10, 10, 10, 10],
'has_weight': False,
- 'setting_list': [u'10', u'10', u'10', u'10'],
+ 'setting_list': ['10', '10', '10', '10'],
'weight_list': [None, None, None, None],
'setting_obj_list': [Setting.objects.get(pk=3)],
- 'setting_text': u'4 \xd7 10',
+ 'setting_text': '4 \xd7 10',
'repetition_units': [repetition_unit,
repetition_unit,
repetition_unit,
diff --git a/wger/manager/tests/test_workout_session.py b/wger/manager/tests/test_workout_session.py
index 5ee09527a..319bd77e9 100644
--- a/wger/manager/tests/test_workout_session.py
+++ b/wger/manager/tests/test_workout_session.py
@@ -99,7 +99,7 @@ class WorkoutSessionModelTestCase(WgerTestCase):
session.workout = Workout.objects.get(pk=1)
session.date = datetime.date.today()
self.assertEqual('{0}'.format(session),
- u'{0} - {1}'.format(Workout.objects.get(pk=1), datetime.date.today()))
+ '{0} - {1}'.format(Workout.objects.get(pk=1), datetime.date.today()))
class DeleteTestWorkoutTestCase(WgerDeleteTestCase):
diff --git a/wger/manager/views/day.py b/wger/manager/views/day.py
index 405932b25..ef6873f21 100644
--- a/wger/manager/views/day.py
+++ b/wger/manager/views/day.py
@@ -97,7 +97,7 @@ class DayEditView(DayView, UpdateView):
# Send some additional data to the template
def get_context_data(self, **kwargs):
context = super(DayEditView, self).get_context_data(**kwargs)
- context['title'] = _(u'Edit {0}').format(self.object)
+ context['title'] = _('Edit {0}').format(self.object)
return context
diff --git a/wger/manager/views/log.py b/wger/manager/views/log.py
index f1ff93ba6..725273bbe 100644
--- a/wger/manager/views/log.py
+++ b/wger/manager/views/log.py
@@ -85,7 +85,7 @@ class WorkoutLogUpdateView(WgerFormMixin, UpdateView, LoginRequiredMixin):
def get_context_data(self, **kwargs):
context = super(WorkoutLogUpdateView, self).get_context_data(**kwargs)
- context['title'] = _(u'Edit log entry for %s') % self.object.exercise.name
+ context['title'] = _('Edit log entry for %s') % self.object.exercise.name
return context
diff --git a/wger/manager/views/schedule.py b/wger/manager/views/schedule.py
index 68946a14b..c40c8ae33 100644
--- a/wger/manager/views/schedule.py
+++ b/wger/manager/views/schedule.py
@@ -156,13 +156,13 @@ def export_pdf_log(request, pk, images=False, comments=False, uidb64=None, token
elements = []
# Set the title
- p = Paragraph(u'<para align="center">{0}</para>'.format(schedule), styleSheet["HeaderBold"])
+ p = Paragraph('<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(u'<para>{0} {1}</para>'.format(step.duration, _('Weeks')),
+ p = Paragraph('<para>{0} {1}</para>'.format(step.duration, _('Weeks')),
styleSheet["HeaderBold"])
elements.append(p)
elements.append(Spacer(10 * cm, 0.5 * cm))
@@ -221,13 +221,13 @@ def export_pdf_table(request, pk, images=False, comments=False, uidb64=None, tok
elements = []
# Set the title
- p = Paragraph(u'<para align="center">{0}</para>'.format(schedule), styleSheet["HeaderBold"])
+ p = Paragraph('<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(u'<para>{0} {1}</para>'.format(step.duration, _('Weeks')),
+ p = Paragraph('<para>{0} {1}</para>'.format(step.duration, _('Weeks')),
styleSheet["HeaderBold"])
elements.append(p)
elements.append(Spacer(10 * cm, 0.5 * cm))
@@ -300,7 +300,7 @@ class ScheduleDeleteView(WgerDeleteMixin, DeleteView, PermissionRequiredMixin):
Send some additional data to the template
"""
context = super(ScheduleDeleteView, self).get_context_data(**kwargs)
- context['title'] = _(u'Delete {0}?').format(self.object)
+ context['title'] = _('Delete {0}?').format(self.object)
return context
@@ -317,5 +317,5 @@ class ScheduleEditView(WgerFormMixin, UpdateView, PermissionRequiredMixin):
Send some additional data to the template
"""
context = super(ScheduleEditView, self).get_context_data(**kwargs)
- context['title'] = _(u'Edit {0}').format(self.object)
+ context['title'] = _('Edit {0}').format(self.object)
return context
diff --git a/wger/manager/views/schedule_step.py b/wger/manager/views/schedule_step.py
index 455dfba73..3cb61c3c4 100644
--- a/wger/manager/views/schedule_step.py
+++ b/wger/manager/views/schedule_step.py
@@ -136,5 +136,5 @@ class StepDeleteView(WgerDeleteMixin, DeleteView, PermissionRequiredMixin):
Send some additional data to the template
"""
context = super(StepDeleteView, self).get_context_data(**kwargs)
- context['title'] = _(u'Delete {0}?').format(self.object)
+ context['title'] = _('Delete {0}?').format(self.object)
return context
diff --git a/wger/manager/views/workout.py b/wger/manager/views/workout.py
index 58a9f0a12..8c2356f35 100644
--- a/wger/manager/views/workout.py
+++ b/wger/manager/views/workout.py
@@ -221,7 +221,7 @@ class WorkoutDeleteView(WgerDeleteMixin, LoginRequiredMixin, DeleteView):
def get_context_data(self, **kwargs):
context = super(WorkoutDeleteView, self).get_context_data(**kwargs)
- context['title'] = _(u'Delete {0}?').format(self.object)
+ context['title'] = _('Delete {0}?').format(self.object)
return context
@@ -235,7 +235,7 @@ class WorkoutEditView(WgerFormMixin, LoginRequiredMixin, UpdateView):
def get_context_data(self, **kwargs):
context = super(WorkoutEditView, self).get_context_data(**kwargs)
- context['title'] = _(u'Edit {0}').format(self.object)
+ context['title'] = _('Edit {0}').format(self.object)
return context
diff --git a/wger/manager/views/workout_session.py b/wger/manager/views/workout_session.py
index 2d68b7e44..ca376487e 100644
--- a/wger/manager/views/workout_session.py
+++ b/wger/manager/views/workout_session.py
@@ -152,7 +152,7 @@ class WorkoutSessionDeleteView(WgerDeleteMixin, LoginRequiredMixin, DeleteView):
logs = '' if not self.kwargs.get('logs') else self.kwargs['logs']
context = super(WorkoutSessionDeleteView, self).get_context_data(**kwargs)
- context['title'] = _(u'Delete {0}?').format(self.object)
+ context['title'] = _('Delete {0}?').format(self.object)
if logs == 'logs':
self.delete_message_extra = _('This will delete all weight logs for this day as well.')
return context
diff --git a/wger/nutrition/models.py b/wger/nutrition/models.py
index 33c532aca..9432358a3 100644
--- a/wger/nutrition/models.py
+++ b/wger/nutrition/models.py
@@ -108,9 +108,9 @@ class NutritionPlan(models.Model):
Return a more human-readable representation
"""
if self.description:
- return u"{0}".format(self.description)
+ return "{0}".format(self.description)
else:
- return u"{0}".format(_("Nutrition plan"))
+ return "{0}".format(_("Nutrition plan"))
def get_absolute_url(self):
"""
@@ -495,7 +495,7 @@ class Ingredient(AbstractSubmissionModel, AbstractLicenseModel, models.Model):
# Send email to administrator
subject = _('New user submitted ingredient')
- message = _(u"""The user {0} submitted a new ingredient "{1}".""".format(
+ message = _("""The user {0} submitted a new ingredient "{1}".""".format(
request.user.username, self.name))
mail.mail_admins(subject,
message,
@@ -566,9 +566,9 @@ class IngredientWeightUnit(models.Model):
Return a more human-readable representation
"""
- return u"{0}{1} ({2}g)".format(self.amount if self.amount > 1 else '',
- self.unit.name,
- self.gram)
+ return "{0}{1} ({2}g)".format(self.amount if self.amount > 1 else '',
+ self.unit.name,
+ self.gram)
class Meal(models.Model):
@@ -595,7 +595,7 @@ class Meal(models.Model):
"""
Return a more human-readable representation
"""
- return u"{0} Meal".format(self.order)
+ return "{0} Meal".format(self.order)
def get_owner_object(self):
"""
@@ -741,7 +741,7 @@ class MealItem(BaseMealItem, models.Model):
"""
Return a more human-readable representation
"""
- return u"{0}g ingredient {1}".format(self.amount, self.ingredient_id)
+ return "{0}g ingredient {1}".format(self.amount, self.ingredient_id)
def get_owner_object(self):
"""
@@ -807,7 +807,7 @@ class LogItem(BaseMealItem, models.Model):
"""
Return a more human-readable representation
"""
- return u"Diary entry for {}, plan {}".format(self.datetime, self.plan.pk)
+ return "Diary entry for {}, plan {}".format(self.datetime, self.plan.pk)
def get_owner_object(self):
"""
diff --git a/wger/nutrition/tests/test_ingredient.py b/wger/nutrition/tests/test_ingredient.py
index fee2142ce..03a8f541a 100644
--- a/wger/nutrition/tests/test_ingredient.py
+++ b/wger/nutrition/tests/test_ingredient.py
@@ -236,14 +236,14 @@ class IngredientValuesTestCase(WgerTestCase):
self.assertEqual(response.status_code, 200)
result = json.loads(response.content.decode('utf8'))
self.assertEqual(len(result), 8)
- self.assertEqual(result, {u'sodium': u'0.01',
- u'energy': u'1.76',
- u'fat': u'0.08',
- u'carbohydrates_sugar': u'0.00',
- u'fat_saturated': u'0.03',
- u'fibres': u'0.00',
- u'protein': u'0.26',
- u'carbohydrates': u'0.00'})
+ self.assertEqual(result, {'sodium': '0.01',
+ 'energy': '1.76',
+ 'fat': '0.08',
+ 'carbohydrates_sugar': '0.00',
+ 'fat_saturated': '0.03',
+ 'fibres': '0.00',
+ 'protein': '0.26',
+ 'carbohydrates': '0.00'})
# Get the nutritional values in 1 unit of product
response = self.client.get(reverse('api-ingredient-get-values', kwargs={'pk': 1}),
@@ -254,14 +254,14 @@ class IngredientValuesTestCase(WgerTestCase):
self.assertEqual(response.status_code, 200)
result = json.loads(response.content.decode('utf8'))
self.assertEqual(len(result), 8)
- self.assertEqual(result, {u'sodium': u'0.61',
- u'energy': u'196.24',
- u'fat': u'9.13',
- u'carbohydrates_sugar': u'0.00',
- u'fat_saturated': u'3.62',
- u'fibres': u'0.00',
- u'protein': u'28.58',
- u'carbohydrates': u'0.14'})
+ self.assertEqual(result, {'sodium': '0.61',
+ 'energy': '196.24',
+ 'fat': '9.13',
+ 'carbohydrates_sugar': '0.00',
+ 'fat_saturated': '3.62',
+ 'fibres': '0.00',
+ 'protein': '28.58',
+ 'carbohydrates': '0.14'})
def test_calculate_value_anonymous(self):
"""
diff --git a/wger/nutrition/views/ingredient.py b/wger/nutrition/views/ingredient.py
index 3465b4f46..c4441bf4b 100644
--- a/wger/nutrition/views/ingredient.py
+++ b/wger/nutrition/views/ingredient.py
@@ -139,7 +139,7 @@ class IngredientDeleteView(WgerDeleteMixin,
def get_context_data(self, **kwargs):
context = super(IngredientDeleteView, self).get_context_data(**kwargs)
- context['title'] = _(u'Delete {0}?').format(self.object)
+ context['title'] = _('Delete {0}?').format(self.object)
return context
@@ -174,7 +174,7 @@ class IngredientEditView(IngredientMixin, LoginRequiredMixin, PermissionRequired
Send some additional data to the template
"""
context = super(IngredientEditView, self).get_context_data(**kwargs)
- context['title'] = _(u'Edit {0}').format(self.object)
+ context['title'] = _('Edit {0}').format(self.object)
return context
diff --git a/wger/nutrition/views/plan.py b/wger/nutrition/views/plan.py
index 70fdc5a4a..282a0e6b6 100644
--- a/wger/nutrition/views/plan.py
+++ b/wger/nutrition/views/plan.py
@@ -125,7 +125,7 @@ class PlanDeleteView(WgerDeleteMixin, DeleteView):
Send some additional data to the template
"""
context = super(PlanDeleteView, self).get_context_data(**kwargs)
- context['title'] = _(u'Delete {0}?').format(self.object)
+ context['title'] = _('Delete {0}?').format(self.object)
return context
@@ -142,7 +142,7 @@ class PlanEditView(WgerFormMixin, UpdateView):
Send some additional data to the template
"""
context = super(PlanEditView, self).get_context_data(**kwargs)
- context['title'] = _(u'Edit {0}').format(self.object)
+ context['title'] = _('Edit {0}').format(self.object)
return context
@@ -279,13 +279,13 @@ def export_pdf(request, id, uidb64=None, token=None):
meal_markers.append(len(data))
if not meal.time:
- p = Paragraph(u'<para align="center"><strong>{nr} {meal_nr}</strong></para>'
+ p = Paragraph('<para align="center"><strong>{nr} {meal_nr}</strong></para>'
.format(nr=_('Nr.'), meal_nr=i),
styleSheet["SubHeader"])
else:
- p = Paragraph(u'<para align="center"><strong>'
- u'{nr} {meal_nr} - {meal_time}'
- u'</strong></para>'
+ p = Paragraph('<para align="center"><strong>'
+ '{nr} {meal_nr} - {meal_time}'
+ '</strong></para>'
.format(nr=_('Nr.'), meal_nr=i, meal_time=meal.time.strftime("%H:%M")),
styleSheet["SubHeader"])
data.append([p])
@@ -294,13 +294,13 @@ def export_pdf(request, id, uidb64=None, token=None):
for item in meal.mealitem_set.select_related():
ingredient_markers.append(len(data))
- p = Paragraph(u'<para>{0}</para>'.format(item.ingredient.name), styleSheet["Normal"])
+ p = Paragraph('<para>{0}</para>'.format(item.ingredient.name), styleSheet["Normal"])
if item.get_unit_type() == MEALITEM_WEIGHT_GRAM:
unit_name = 'g'
else:
unit_name = ' × ' + item.weight_unit.unit.name
- data.append([Paragraph(u"{0:.0f}{1}".format(item.amount, unit_name),
+ data.append([Paragraph("{0:.0f}{1}".format(item.amount, unit_name),
styleSheet["Normal"]), p])
# Add filler
@@ -351,7 +351,7 @@ def export_pdf(request, id, uidb64=None, token=None):
# Create table with nutritional calculations
data = []
- data.append([Paragraph(u'<para align="center">{0}</para>'.format(_('Nutritional data')),
+ data.append([Paragraph('<para align="center">{0}</para>'.format(_('Nutritional data')),
styleSheet["SubHeaderBlack"])])
data.append([Paragraph(_('Macronutrients'), styleSheet["Normal"]),
Paragraph(_('Total'), styleSheet["Normal"]),
diff --git a/wger/nutrition/views/unit.py b/wger/nutrition/views/unit.py
index 8451736a0..e8c73ceba 100644
--- a/wger/nutrition/views/unit.py
+++ b/wger/nutrition/views/unit.py
@@ -111,7 +111,7 @@ class WeightUnitDeleteView(WgerDeleteMixin,
Send some additional data to the template
"""
context = super(WeightUnitDeleteView, self).get_context_data(**kwargs)
- context['title'] = _(u'Delete {0}?').format(self.object)
+ context['title'] = _('Delete {0}?').format(self.object)
return context
@@ -135,5 +135,5 @@ class WeightUnitUpdateView(WgerFormMixin,
Send some additional data to the template
"""
context = super(WeightUnitUpdateView, self).get_context_data(**kwargs)
- context['title'] = _(u'Edit {0}').format(self.object)
+ context['title'] = _('Edit {0}').format(self.object)
return context
diff --git a/wger/settings_global.py b/wger/settings_global.py
index e7d7d188f..06a991484 100644
--- a/wger/settings_global.py
+++ b/wger/settings_global.py
@@ -194,7 +194,7 @@ LANGUAGES = (
('de', 'German'),
('bg', 'Bulgarian'),
('es', 'Spanish'),
- ('ru', 'Russian'),
+ ('r', 'Russian'),
('nl', 'Dutch'),
('pt', 'Portuguese'),
('el', 'Greek'),
diff --git a/wger/utils/context_processor.py b/wger/utils/context_processor.py
index 11cac4480..60e438ea7 100644
--- a/wger/utils/context_processor.py
+++ b/wger/utils/context_processor.py
@@ -32,7 +32,7 @@ def processor(request):
static_path = static('images/logos/logo-marketplace-256.png')
for lang in settings.LANGUAGES:
- i18n_path[lang[0]] = u'/{0}{1}'.format(lang[0], full_path[3:])
+ i18n_path[lang[0]] = '/{0}{1}'.format(lang[0], full_path[3:])
context = {
# Application version
diff --git a/wger/utils/helpers.py b/wger/utils/helpers.py
index e7c0e36e1..627f35aa6 100644
--- a/wger/utils/helpers.py
+++ b/wger/utils/helpers.py
@@ -230,7 +230,7 @@ def smart_capitalize(input):
"""
out = []
for word in input.split(' '):
- if len(word) > 2 and word[0] != u'ß':
+ if len(word) > 2 and word[0] != 'ß':
out.append(word[:1].upper() + word[1:])
else:
out.append(word)
diff --git a/wger/utils/widgets.py b/wger/utils/widgets.py
index 5b6ac5af2..1c2e1177e 100644
--- a/wger/utils/widgets.py
+++ b/wger/utils/widgets.py
@@ -107,9 +107,9 @@ class ExerciseAjaxSelect(SelectMultiple):
if value is None:
value = []
- output = [u'<div>']
- output.append(u'<input type="text" id="exercise-search" class="form-control">')
- output.append(u'</div>')
+ output = ['<div>']
+ output.append('<input type="text" id="exercise-search" class="form-control">')
+ output.append('</div>')
output.append('<div id="exercise-search-log">')
options = self.render_options(choices, value)
@@ -117,7 +117,7 @@ class ExerciseAjaxSelect(SelectMultiple):
output.append(options)
output.append('</div>')
- return mark_safe(u'\n'.join(output))
+ return mark_safe('\n'.join(output))
def render_options(self, choices, selected_choices):
# Normalize to strings.
@@ -125,13 +125,13 @@ class ExerciseAjaxSelect(SelectMultiple):
output = []
for option_value, option_label in chain(self.choices, choices):
output.append(self.render_option(selected_choices, option_value, option_label))
- return u'\n'.join(output)
+ return '\n'.join(output)
def render_option(self, selected_choices, option_value, option_label):
option_value = force_text(option_value)
if option_value in selected_choices:
- return u"""
+ return """
<div id="a%(div_id)s" class="ajax-exercise-select">
<a href="#">
<img src="/static/images/icons/status-off.svg"
@@ -174,7 +174,7 @@ class CheckboxChoiceInputTranslatedOriginal(CheckboxInput):
def __init__(self, name, value, attrs, choice, index):
if _(choice[1]) != choice[1]:
- choice = (choice[0], u"{0} ({1})".format(choice[1], _(choice[1])))
+ choice = (choice[0], "{0} ({1})".format(choice[1], _(choice[1])))
else:
choice = (choice[0], _(choice[1]))
diff --git a/wger/weight/models.py b/wger/weight/models.py
index 2a73ca1b8..2d3214d25 100644
--- a/wger/weight/models.py
+++ b/wger/weight/models.py
@@ -60,7 +60,7 @@ class WeightEntry(models.Model):
"""
Return a more human-readable representation
"""
- return u"{0}: {1:.2f} kg".format(self.date, self.weight)
+ return "{0}: {1:.2f} kg".format(self.date, self.weight)
def get_owner_object(self):
"""