diff --git a/app/controllers/users/description_controller.rb b/app/controllers/users/description_controller.rb index 9798ea3cf..c792777ae 100644 --- a/app/controllers/users/description_controller.rb +++ b/app/controllers/users/description_controller.rb @@ -34,8 +34,7 @@ class Users::DescriptionController < UsersController @champs = @dossier.ordered_champs - check_mandatory_fields = true - check_mandatory_fields = !(params[:submit].keys.first == 'brouillon') if params[:submit] + check_mandatory_fields = !draft_submission? if params[:champs] champs_service_errors = ChampsService.save_champs @dossier.champs, @@ -116,6 +115,10 @@ class Users::DescriptionController < UsersController private + def draft_submission? + params[:submit] && params[:submit].keys.first == 'brouillon' + end + def check_autorisation_donnees @dossier = current_user_dossier