Private
Public Access
1
0

fixed rights

This commit is contained in:
Sander Roosendaal
2020-02-29 17:27:42 +01:00
parent 30ad6bef11
commit f13e9f7fba
4 changed files with 36 additions and 26 deletions

View File

@@ -474,6 +474,17 @@ def get_workout(id):
return w
def get_workoutuser(id,request):
try:
id = encoder.decode_hex(id)
w = Workout.objects.get(id=id)
except Workout.DoesNotExist:
raise Http404("Workout doesn't exist")
if not is_workout_user(request.user,w):
raise PermissionDenied
return w
def getvalue(data):
perc = 0