Skip to content

Commit

Permalink
[webui] Fix Repository validation bug.
Browse files Browse the repository at this point in the history
The uniqueness validation was considering two repositories with empty
strings for the alias as invalid.
  • Loading branch information
Evan Rolfe committed Oct 27, 2017
1 parent 14cee74 commit 53ce663
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/app/models/kiwi/repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 53ce663

Please sign in to comment.