BigW Consortium Gitlab

Commit 07f156f5 by Dmitriy Zaporozhets

Dont update namespace if User name was changed. Use user#username for namespace…

Dont update namespace if User name was changed. Use user#username for namespace name because Namespace#name validates by uniq
parent 3d41e182
......@@ -13,8 +13,8 @@ class UserObserver < BaseObserver
# Ensure user has namespace
user.create_namespace!(path: user.username, name: user.username) unless user.namespace
if user.username_changed? || user.name_changed?
user.namespace.update_attributes(path: user.username, name: user.name)
if user.username_changed?
user.namespace.update_attributes(path: user.username, name: user.username)
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment