Skip to content

Commit 968b875

Browse files
committed
Don't call @user.save twice
1 parent d71bdd8 commit 968b875

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

app/controllers/api/v8/users_controller.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class UsersController < Api::V8::BaseController
7070
schema do
7171
key :title, :status
7272
key :required, [:status]
73-
property :status, type: :string, example: 'Password managed by courses.mooc.fi set to true.'
73+
property :status, type: :string, example: 'Password managed by courses.mooc.fi set to true and password deleted.'
7474
end
7575
end
7676
end
@@ -180,7 +180,6 @@ def set_password_managed_by_courses_mooc_fi
180180
@user.password_hash = nil
181181
@user.salt = nil
182182
@user.argon_hash = nil
183-
@user.save!
184183
raise ActiveRecord::Rollback if !@user.errors.empty? || !@user.save
185184
return render json: {
186185
status: 'Password managed by courses.mooc.fi set to true and password deleted.'

0 commit comments

Comments
 (0)