Self hosted FLOSS fitness/workout, nutrition and weight tracker
Revert e8012f4..c741393
James Simas4b02e66c7e64
diff --git a/AUTHORS.rst b/AUTHORS.rstindex 4bb48da27..dbd72f367 100644--- a/AUTHORS.rst+++ b/AUTHORS.rst@@ -10,7 +10,6 @@ Developers* Matheus Zorzete Marchiore - https://github.com/marchiore* Yu Yu Aung - https://github.com/max111* Laszlo Ratsko - https://github.com/rlaszlo-* James Simas - https://github.com/jamessimasTranslators-----------diff --git a/wger/manager/templates/workout/view.html b/wger/manager/templates/workout/view.htmlindex b61bf5a06..1c3c5ef68 100644--- a/wger/manager/templates/workout/view.html+++ b/wger/manager/templates/workout/view.html@@ -171,6 +171,7 @@ $(document).ready(function() {</a></p>+{% if is_owner %}<p><a href="{% url 'manager:workout:copy' workout.id %}"class="wger-modal-dialog">@@ -183,7 +184,6 @@ $(document).ready(function() {</a></p>-{% if is_owner %}<p><a href="{% url 'manager:workout:delete' workout.id %}"class="wger-modal-dialog">diff --git a/wger/manager/views/workout.py b/wger/manager/views/workout.pyindex 21f1c3c17..1f86ded58 100644--- a/wger/manager/views/workout.py+++ b/wger/manager/views/workout.py@@ -114,12 +114,7 @@ def copy_workout(request, pk):Makes a copy of a workout'''- workout = get_object_or_404(Workout, pk=pk)- user = workout.user- is_owner = request.user == user-- if not is_owner and not user.userprofile.ro_access:- return HttpResponseForbidden()+ workout = get_object_or_404(Workout, pk=pk, user=request.user)# Process requestif request.method == 'POST':@@ -133,7 +128,6 @@ def copy_workout(request, pk):workout_copy = workoutworkout_copy.pk = Noneworkout_copy.comment = workout_form.cleaned_data['comment']- workout_copy.user = request.userworkout_copy.save()# Copy the days