summaryrefslogtreecommitdiff
path: root/app/models/namespace.rb
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-10-01 23:13:40 -0400
committerStan Hu <stanhu@gmail.com>2018-10-02 06:36:58 -0400
commitbba99da98cd0b3d8fbcee7b02fb3d0ad7d642a24 (patch)
treec74fb0ae9581228fb96892d363a7eb0413ceb55c /app/models/namespace.rb
parent2bb8c1caa583e1efbc207c4093ea2159bfcc1db1 (diff)
downloadgitlab-ce-bba99da98cd0b3d8fbcee7b02fb3d0ad7d642a24.tar.gz
Improve logging when username update fails due to registry tags
When a user cannot be renamed due to existing container registry tags, log the namespace and an example project that has tags.
Diffstat (limited to 'app/models/namespace.rb')
-rw-r--r--app/models/namespace.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb
index c54be778d1b..599bedde27d 100644
--- a/app/models/namespace.rb
+++ b/app/models/namespace.rb
@@ -135,6 +135,10 @@ class Namespace < ActiveRecord::Base
all_projects.any?(&:has_container_registry_tags?)
end
+ def first_project_with_container_registry_tags
+ all_projects.find(&:has_container_registry_tags?)
+ end
+
def send_update_instructions
projects.each do |project|
project.send_move_instructions("#{full_path_was}/#{project.path}")