summaryrefslogtreecommitdiff
path: root/app/services/projects/update_service.rb
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2017-07-24 10:47:33 +0000
committerRémy Coutable <remy@rymai.me>2017-07-24 10:47:33 +0000
commit4ad8f12e44b81bb5a07a5365ec0fc5fdba19094e (patch)
tree73a0d96336fc9f65309ae4d0ab4f447ca0cadfab /app/services/projects/update_service.rb
parentd384b6a04782d90f2728307be7e92d0923fff524 (diff)
downloadgitlab-ce-4ad8f12e44b81bb5a07a5365ec0fc5fdba19094e.tar.gz
Fix editing project with container images present
Diffstat (limited to 'app/services/projects/update_service.rb')
-rw-r--r--app/services/projects/update_service.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/services/projects/update_service.rb b/app/services/projects/update_service.rb
index 30ca95eef7a..d81035e4eba 100644
--- a/app/services/projects/update_service.rb
+++ b/app/services/projects/update_service.rb
@@ -5,7 +5,7 @@ module Projects
return error('New visibility level not allowed!')
end
- if project.has_container_registry_tags?
+ if renaming_project_with_container_registry_tags?
return error('Cannot rename project because it contains container registry tags!')
end
@@ -44,6 +44,13 @@ module Projects
true
end
+ def renaming_project_with_container_registry_tags?
+ new_path = params[:path]
+
+ new_path && new_path != project.path &&
+ project.has_container_registry_tags?
+ end
+
def changing_default_branch?
new_branch = params[:default_branch]