Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Fix further occurences of weight overview URL

Roland Geider9bc395f19170
diff --git a/wger/core/templates/mobile/index.html b/wger/core/templates/mobile/index.html
index bd5f45719..864de4615 100644
--- a/wger/core/templates/mobile/index.html
+++ b/wger/core/templates/mobile/index.html
@@ -223,7 +223,7 @@ its default duration in your settings.{% endblocktrans %}
{% endif %}
</div>
<div class="col-xs-6" style="padding-left: 7px;">
- <a href="{% url 'weight:overview' %}" class="btn btn-default btn-block">
+ <a href="{% url 'weight:overview' user.username %}" class="btn btn-default btn-block">
<img src="{% static 'images/icons/statistics.svg' %}"
width="32"
height="32"
diff --git a/wger/core/templates/user/overview.html b/wger/core/templates/user/overview.html
index 512dec61b..cdd5afd60 100644
--- a/wger/core/templates/user/overview.html
+++ b/wger/core/templates/user/overview.html
@@ -126,7 +126,7 @@
</tbody>
</table>
{% if perms.gym.gym_trainer %}
-<a href="{{trainer_login}}?next={% url 'weight:overview' %}" class="btn btn-default btn-sm">{% trans "Weight overview" %}</a>
+<a href="{{trainer_login}}?next={% url 'weight:overview' current_user.username %}" class="btn btn-default btn-sm">{% trans "Weight overview" %}</a>
{% endif %}
diff --git a/wger/core/tests/test_temporary_users.py b/wger/core/tests/test_temporary_users.py
index 2f48ebc84..7150cafc8 100644
--- a/wger/core/tests/test_temporary_users.py
+++ b/wger/core/tests/test_temporary_users.py
@@ -120,7 +120,7 @@ class DemoUserTestCase(WorkoutManagerTestCase):
self.assertEqual(self.count_temp_users(), 1)
self.user_logout()
- self.client.get(reverse('weight:overview'))
+ reverse('weight:overview', kwargs={'username': 'test'})
self.assertEqual(self.count_temp_users(), 1)
self.user_logout()
diff --git a/wger/manager/management/commands/email-weight-reminder.py b/wger/manager/management/commands/email-weight-reminder.py
index 7577352b4..d4b75fc21 100644
--- a/wger/manager/management/commands/email-weight-reminder.py
+++ b/wger/manager/management/commands/email-weight-reminder.py
@@ -73,6 +73,7 @@ class Command(BaseCommand):
context['site'] = Site.objects.get_current()
context['date'] = last_entry
context['days'] = datediff
+ context['user'] = user
subject = _('You have to enter your weight')
message = loader.render_to_string('workout/email_weight_reminder.tpl', context)
diff --git a/wger/manager/templates/workout/email_weight_reminder.tpl b/wger/manager/templates/workout/email_weight_reminder.tpl
index 65075c85b..662b4c589 100644
--- a/wger/manager/templates/workout/email_weight_reminder.tpl
+++ b/wger/manager/templates/workout/email_weight_reminder.tpl
@@ -12,5 +12,5 @@ option in your settings.{% endblocktrans %}
{% trans "the wger.de team" %}
-* https://{{site}}{% url 'weight:overview' %}
+* https://{{site}}{% url 'weight:overview' user.username %}
* https://{{site}}{% url 'core:user:preferences' %}
\ No newline at end of file