Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Only logged-in users can access the weight application

Roland Geider660bbca60a1f
diff --git a/weight/views.py b/weight/views.py
index 19ccc544b..16a8c1548 100644
--- a/weight/views.py
+++ b/weight/views.py
@@ -20,6 +20,7 @@ from django.shortcuts import get_object_or_404
from django.http import HttpResponseRedirect
from django.forms import ModelForm
from django.core.context_processors import csrf
+from django.contrib.auth.decorators import permission_required, login_required
from weight.models import WeightEntry
@@ -30,6 +31,7 @@ class WeightForm(ModelForm):
class Meta:
model = WeightEntry
+@login_required
def add(request, id=None):
"""Add a weight entry
"""
@@ -61,6 +63,7 @@ def add(request, id=None):
return render_to_response('edit.html', template_data)
+@login_required
def overview(request):
"""Shows an overview of weight data
@@ -80,4 +83,4 @@ def overview(request):
template_data['data_x'] = data_x
template_data['data_y'] = data_y
- return render_to_response('weight_overview.html', template_data)
\ No newline at end of file
+ return render_to_response('weight_overview.html', template_data)