Skip to content

Commit

Permalink
Merge pull request #4122 from mschnitzer/issue_4048
Browse files Browse the repository at this point in the history
[webui] Don't raise an exception when 'image' repo already exists
  • Loading branch information
Ana06 committed Dec 5, 2017
2 parents b62ee60 + 39810f4 commit 080a0d1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/api/app/controllers/webui/repositories_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,16 @@ def create_dod_repository
# POST project/create_image_repository
def create_image_repository
authorize @project, :update?
repository = @project.repositories.create!(name: 'images')
Architecture.available.each do |architecture|
repository.repository_architectures.create!(architecture: architecture)
end
@project.prepend_kiwi_config
repository = @project.repositories.new(name: 'images')

if repository.save
Architecture.available.each do |architecture|
repository.repository_architectures.create(architecture: architecture)
end

@project.prepend_kiwi_config
@project.store

flash[:success] = 'Successfully added image repository'
respond_to do |format|
format.html { redirect_to({ action: :index, project: @project }) }
Expand Down

0 comments on commit 080a0d1

Please sign in to comment.