AdminProcedureController: fix self assignation as instructeur
This commit is contained in:
parent
ad31822a68
commit
efd793f266
1 changed files with 1 additions and 4 deletions
|
@ -76,10 +76,7 @@ class Admin::ProceduresController < AdminController
|
||||||
render 'new'
|
render 'new'
|
||||||
else
|
else
|
||||||
flash.notice = 'Démarche enregistrée.'
|
flash.notice = 'Démarche enregistrée.'
|
||||||
instructeur = Instructeur.find_by(email: current_administrateur.email)
|
current_administrateur.instructeur.assign_to_procedure(@procedure)
|
||||||
if instructeur
|
|
||||||
instructeur.assign_to_procedure(@procedure)
|
|
||||||
end
|
|
||||||
|
|
||||||
redirect_to champs_procedure_path(@procedure)
|
redirect_to champs_procedure_path(@procedure)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue