summaryrefslogtreecommitdiff
path: root/app/services/users
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2017-06-14 12:39:58 +0200
committerJames Lopez <james@jameslopez.es>2017-06-23 11:41:41 +0200
commit01378ab4a57dfbca589efdffb6d13e1830913106 (patch)
tree4723e360808c405648a0b8f89a2a600166097a13 /app/services/users
parent59c3968c40a1146f5370ae3b634aac2d4a045733 (diff)
downloadgitlab-ce-01378ab4a57dfbca589efdffb6d13e1830913106.tar.gz
update profiles controller to use new service
Diffstat (limited to 'app/services/users')
-rw-r--r--app/services/users/update_service.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/services/users/update_service.rb b/app/services/users/update_service.rb
index 866eb070913..977124298bf 100644
--- a/app/services/users/update_service.rb
+++ b/app/services/users/update_service.rb
@@ -10,17 +10,17 @@ module Users
def execute(skip_authorization: false, &block)
assign_attributes(skip_authorization, &block)
- if @user.save
+ if @user.save || !@user.changed?
success
else
- error('User could not be updated')
+ error("User could not be updated #{@user.errors.full_messages.uniq.join('. ')}" )
end
end
def execute!(skip_authorization: false, &block)
assign_attributes(skip_authorization, &block)
- @user.save!
+ @user.save! if @user.changed?
end
private