diff --git a/rowers/templates/embedded_video.html b/rowers/templates/embedded_video.html index 789eb3c5..298577e6 100644 --- a/rowers/templates/embedded_video.html +++ b/rowers/templates/embedded_video.html @@ -306,7 +306,7 @@ function copyText() { } - {% if user.is_authenticated and user == workout.user.user %} + {% if user.is_authenticated and workout|may_edit:request %}
  • Lock Data and Video
  • @@ -322,7 +322,7 @@ function copyText() {
  • - {% if form and user.is_authenticated and user == workout.user.user %} + {% if form and user.is_authenticated and workout|may_edit:request %} {{ form.as_table }} diff --git a/rowers/views/workoutviews.py b/rowers/views/workoutviews.py index 6e7b8545..e113f19d 100644 --- a/rowers/views/workoutviews.py +++ b/rowers/views/workoutviews.py @@ -172,6 +172,9 @@ def workout_video_create_view(request,id=0): else: mode = 'erg' + + mayedit = checkworkoutuser(request.user,w) and isprorower(request.user.rower) + # get video ID and offset if request.method == 'POST': form = VideoAnalysisCreateForm(request.POST)