Merge pull request #5671 from betagouv/dev

2020-10-06-01
This commit is contained in:
Kara Diaby 2020-10-06 15:28:38 +02:00 committed by GitHub
commit 6b3d2fca56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View file

@ -184,7 +184,7 @@ class Procedure < ApplicationRecord
validates :lien_site_web, presence: true, if: :publiee?
validate :validate_for_publication, on: :publication
validate :check_juridique
validates :path, presence: true, format: { with: /\A[a-z0-9_\-]{3,50}\z/ }, uniqueness: { scope: [:path, :closed_at, :hidden_at, :unpublished_at], case_sensitive: false }
validates :path, presence: true, format: { with: /\A[a-z0-9_\-]{3,200}\z/ }, uniqueness: { scope: [:path, :closed_at, :hidden_at, :unpublished_at], case_sensitive: false }
validates :duree_conservation_dossiers_dans_ds, allow_nil: false, numericality: { only_integer: true, greater_than_or_equal_to: 1, less_than_or_equal_to: MAX_DUREE_CONSERVATION }
validates :duree_conservation_dossiers_hors_ds, allow_nil: false, numericality: { only_integer: true, greater_than_or_equal_to: 0 }
validates_with MonAvisEmbedValidator

View file

@ -76,8 +76,10 @@
- else
Choix du service administratif
.card-admin-action
- if @procedure.service_id.blank? && current_administrateur.services.present?
= link_to 'Modifier', admin_services_path(procedure_id: @procedure.id), class: 'button'
- if @procedure.service.present?
= link_to 'Modifier', edit_admin_service_path(@procedure.service), class: 'button'
- elsif current_administrateur.services.present?
= link_to 'Choisir', admin_services_path(procedure_id: @procedure.id), class: 'button'
- else
= link_to 'Remplir', new_admin_service_path(procedure_id: @procedure.id), class: 'button'