DescriptionController: refactor check_mandatory_fields
This commit is contained in:
parent
191b29aff5
commit
d14a75c24a
1 changed files with 5 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue