From 53ce663f9e54c52709e3493b45ebe238c67b5cbb Mon Sep 17 00:00:00 2001 From: Evan Rolfe Date: Fri, 27 Oct 2017 08:57:11 +0100 Subject: [PATCH] [webui] Fix Repository validation bug. The uniqueness validation was considering two repositories with empty strings for the alias as invalid. --- src/api/app/models/kiwi/repository.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/app/models/kiwi/repository.rb b/src/api/app/models/kiwi/repository.rb index eaaaedf2752..410e557edfd 100644 --- a/src/api/app/models/kiwi/repository.rb +++ b/src/api/app/models/kiwi/repository.rb @@ -19,7 +19,7 @@ class Repository < ApplicationRecord #### Scopes (first the default_scope macro if is used) #### Validations macros - validates :alias, :source_path, uniqueness: { scope: :image, message: "%{attribute} '%{value}' has already been taken."} + validates :alias, :source_path, uniqueness: { scope: :image, message: "%{attribute} '%{value}' has already been taken."}, allow_blank: true validates :source_path, presence: { message: '%{attribute} can\'t be nil.'} validate :source_path_format validates :priority, numericality: { only_integer: true, allow_nil: true, greater_than_or_equal_to: 0,