Dont update namespace if User name was changed. Use user#username for namespace name because Namespace#name validates by uniq
This commit is contained in:
parent
3d41e182c2
commit
07f156f5c2
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue