mirror of
https://git.bsd.gay/fef/nyastodon.git
synced 2024-12-25 07:23:43 +01:00
Fix preferences save
This commit is contained in:
parent
ac035108aa
commit
714e41d472
1 changed files with 3 additions and 3 deletions
|
@ -21,9 +21,9 @@ class Settings::PreferencesController < ApplicationController
|
||||||
must_be_following: user_params[:interactions][:must_be_following] == '1',
|
must_be_following: user_params[:interactions][:must_be_following] == '1',
|
||||||
}
|
}
|
||||||
|
|
||||||
current_user.settings['default_privacy'] = user_params[:settings][:default_privacy]
|
current_user.settings['default_privacy'] = user_params[:setting_default_privacy]
|
||||||
|
|
||||||
if current_user.update(user_params.except(:notification_emails, :interactions, :settings))
|
if current_user.update(user_params.except(:notification_emails, :interactions, :setting_default_privacy))
|
||||||
redirect_to settings_preferences_path, notice: I18n.t('generic.changes_saved_msg')
|
redirect_to settings_preferences_path, notice: I18n.t('generic.changes_saved_msg')
|
||||||
else
|
else
|
||||||
render action: :show
|
render action: :show
|
||||||
|
@ -33,6 +33,6 @@ class Settings::PreferencesController < ApplicationController
|
||||||
private
|
private
|
||||||
|
|
||||||
def user_params
|
def user_params
|
||||||
params.require(:user).permit(:locale, settings: [:default_privacy], notification_emails: [:follow, :follow_request, :reblog, :favourite, :mention], interactions: [:must_be_follower, :must_be_following])
|
params.require(:user).permit(:locale, :setting_default_privacy, notification_emails: [:follow, :follow_request, :reblog, :favourite, :mention], interactions: [:must_be_follower, :must_be_following])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue