Can get dossier vide if procedure is closed
This commit is contained in:
parent
29e3b3f831
commit
e087582f57
2 changed files with 15 additions and 5 deletions
|
@ -19,14 +19,14 @@ module Users
|
|||
end
|
||||
|
||||
def dossier_vide_pdf
|
||||
@procedure = retrieve_procedure
|
||||
@procedure = retrieve_procedure_with_closed
|
||||
return procedure_not_found if @procedure.blank? || @procedure.brouillon?
|
||||
|
||||
generate_empty_pdf(@procedure.published_revision)
|
||||
end
|
||||
|
||||
def dossier_vide_pdf_test
|
||||
@procedure = retrieve_procedure
|
||||
@procedure = retrieve_procedure_with_closed
|
||||
return procedure_not_found if @procedure.blank? || (@procedure.publiee? && !@procedure.draft_changed?)
|
||||
|
||||
generate_empty_pdf(@procedure.draft_revision)
|
||||
|
@ -66,6 +66,10 @@ module Users
|
|||
Procedure.publiees.or(Procedure.brouillons).find_by(path: params[:path])
|
||||
end
|
||||
|
||||
def retrieve_procedure_with_closed
|
||||
Procedure.publiees.or(Procedure.brouillons).or(Procedure.closes).find_by(path: params[:path])
|
||||
end
|
||||
|
||||
def procedure_not_found
|
||||
procedure = Procedure.find_by(path: params[:path])
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue