Self hosted FLOSS fitness/workout, nutrition and weight tracker
Properly protect the gym config view
Roland Geider47ee5af93b3c
diff --git a/wger/config/views/gym_config.py b/wger/config/views/gym_config.pyindex 3c8855c3c..a65980b05 100644--- a/wger/config/views/gym_config.py+++ b/wger/config/views/gym_config.py@@ -24,19 +24,23 @@ from django.views.generic import UpdateView# wgerfrom wger.config.models import GymConfig-from wger.utils.generic_views import WgerFormMixin+from wger.utils.generic_views import (+ WgerFormMixin,+ WgerPermissionMixin,+)logger = logging.getLogger(__name__)-class GymConfigUpdateView(WgerFormMixin, UpdateView):+class GymConfigUpdateView(WgerPermissionMixin, WgerFormMixin, UpdateView):"""Generic view to edit the gym config table"""model = GymConfigfields = ('default_gym',)+ login_required = Truepermission_required = 'config.change_gymconfig'success_url = reverse_lazy('gym:gym:list')title = gettext_lazy('Edit')