mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Replace User.unstage and User#unstage API with User#unstage! (#8906)
* DEV: Replace User.unstage and User#unstage API with User#unstage! Quoting @SamSaffron: > User.unstage mixes concerns of both unstaging users and updating params which is fragile/surprising. > u.unstage destroys notifications and raises a user_unstaged event prior to the user becoming unstaged and the user object being saved. User#unstage! no longer updates user attributes and saves the object before triggering the `user_unstaged` event. * Update one more spec * Assign attributes after unstaging
This commit is contained in:
@@ -74,8 +74,7 @@ class DiscourseSingleSignOn < SingleSignOn
|
||||
end
|
||||
|
||||
# ensure it's not staged anymore
|
||||
user.unstage
|
||||
user.save
|
||||
user.unstage!
|
||||
|
||||
change_external_attributes_and_override(sso_record, user)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user