Chef instru peut maintenant changer les infos d'instru
This commit is contained in:
parent
bc7430cb5d
commit
f88ed9ece6
1 changed files with 2 additions and 1 deletions
|
@ -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)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue