From f88ed9ece6cc0e099a06ed74ff904c837f90ad97 Mon Sep 17 00:00:00 2001 From: Maurice Debray Date: Mon, 21 Feb 2022 00:47:03 +0100 Subject: [PATCH] Chef instru peut maintenant changer les infos d'instru --- instruments/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/instruments/views.py b/instruments/views.py index f69d920..4c503f7 100644 --- a/instruments/views.py +++ b/instruments/views.py @@ -105,11 +105,12 @@ class FicheInstru(LoginRequiredMixin, TemplateView): def post(self, request, *args, **kwargs): instru = get_object_or_404(self.model, id=self.kwargs["pk"]) form = ChefEditInstrumentForm(request.POST, instance=instru) - if request.user.profile.is_chef: + if request.user.profile.is_chef or request.user.profile.is_chef_instru: if form.is_valid(): form.save() context = self.get_context_data() context["form"] = form + print(instru.user) return render(request, self.template_name, context)