Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraoh0x7DE <aoh02014@mymail.pomona.edu>2016-07-06 02:57:23 +0300
committerJonne Haß <me@jhass.eu>2016-07-06 02:57:23 +0300
commitd75f795cad0973ebb2969b61086ee2fa2ac0f630 (patch)
tree1a740ae50aa5b5c88252a59bec13c4c4fe4f164f /app/controllers
parent5778e7b38639bcee8d2cb8f25c14287ada4d074a (diff)
Fix issue #6847 (#6905)
* Fix issue #6847
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/users_controller.rb49
1 files changed, 25 insertions, 24 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 0e67c7b01..48d99c64b 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -25,49 +25,50 @@ class UsersController < ApplicationController
# change email notifications
if u[:email_preferences]
@user.update_user_preferences(u[:email_preferences])
- flash[:notice] = I18n.t 'users.update.email_notifications_changed'
+ flash[:notice] = I18n.t "users.update.email_notifications_changed"
# change password
elsif params[:change_password]
if @user.update_with_password(u)
password_changed = true
- flash[:notice] = I18n.t 'users.update.password_changed'
+ flash[:notice] = I18n.t "users.update.password_changed"
else
- flash[:error] = I18n.t 'users.update.password_not_changed'
+ flash[:error] = I18n.t "users.update.password_not_changed"
end
elsif u[:show_community_spotlight_in_stream] || u[:getting_started]
if @user.update_attributes(u)
- flash[:notice] = I18n.t 'users.update.settings_updated'
+ flash[:notice] = I18n.t "users.update.settings_updated"
else
- flash[:notice] = I18n.t 'users.update.settings_not_updated'
+ flash[:notice] = I18n.t "users.update.settings_not_updated"
end
elsif u[:strip_exif]
if @user.update_attributes(u)
- flash[:notice] = I18n.t 'users.update.settings_updated'
+ flash[:notice] = I18n.t "users.update.settings_updated"
else
- flash[:notice] = I18n.t 'users.update.settings_not_updated'
+ flash[:notice] = I18n.t "users.update.settings_not_updated"
end
elsif u[:language]
if @user.update_attributes(u)
I18n.locale = @user.language
- flash[:notice] = I18n.t 'users.update.language_changed'
+ flash[:notice] = I18n.t "users.update.language_changed"
else
- flash[:error] = I18n.t 'users.update.language_not_changed'
+ flash[:error] = I18n.t "users.update.language_not_changed"
end
elsif u[:email]
@user.unconfirmed_email = u[:email]
if @user.save
@user.send_confirm_email
if @user.unconfirmed_email
- flash[:notice] = I18n.t 'users.update.unconfirmed_email_changed'
+ flash[:notice] = I18n.t "users.update.unconfirmed_email_changed"
end
else
- flash[:error] = I18n.t 'users.update.unconfirmed_email_not_changed'
+ @user.reload # match user object with the database
+ flash[:error] = I18n.t "users.update.unconfirmed_email_not_changed"
end
elsif u[:auto_follow_back]
if @user.update_attributes(u)
- flash[:notice] = I18n.t 'users.update.follow_settings_changed'
+ flash[:notice] = I18n.t "users.update.follow_settings_changed"
else
- flash[:error] = I18n.t 'users.update.follow_settings_not_changed'
+ flash[:error] = I18n.t "users.update.follow_settings_not_changed"
end
elsif u[:color_theme]
if @user.update_attributes(u)
@@ -98,9 +99,9 @@ class UsersController < ApplicationController
redirect_to(new_user_session_path(format: request[:format]), notice: I18n.t("users.destroy.success"))
else
if params[:user].present? && params[:user][:current_password].present?
- flash[:error] = t 'users.destroy.wrong_password'
+ flash[:error] = t "users.destroy.wrong_password"
else
- flash[:error] = t 'users.destroy.no_password'
+ flash[:error] = t "users.destroy.no_password"
end
redirect_to :back
end
@@ -111,16 +112,16 @@ class UsersController < ApplicationController
respond_to do |format|
format.atom do
@posts = Post.where(author_id: @user.person_id, public: true)
- .order('created_at DESC')
- .limit(25)
- .map {|post| post.is_a?(Reshare) ? post.absolute_root : post }
- .compact
+ .order("created_at DESC")
+ .limit(25)
+ .map {|post| post.is_a?(Reshare) ? post.absolute_root : post }
+ .compact
end
format.any { redirect_to person_path(@user.person) }
end
else
- redirect_to stream_path, :error => I18n.t('users.public.does_not_exist', :username => params[:username])
+ redirect_to stream_path, error: I18n.t("users.public.does_not_exist", username: params[:username])
end
end
@@ -141,7 +142,7 @@ class UsersController < ApplicationController
def export_profile
current_user.queue_export
- flash[:notice] = I18n.t('users.edit.export_in_progress')
+ flash[:notice] = I18n.t("users.edit.export_in_progress")
redirect_to edit_user_path
end
@@ -151,7 +152,7 @@ class UsersController < ApplicationController
def export_photos
current_user.queue_export_photos
- flash[:notice] = I18n.t('users.edit.export_photos_in_progress')
+ flash[:notice] = I18n.t("users.edit.export_photos_in_progress")
redirect_to edit_user_path
end
@@ -171,9 +172,9 @@ class UsersController < ApplicationController
def confirm_email
if current_user.confirm_email(params[:token])
- flash[:notice] = I18n.t('users.confirm_email.email_confirmed', :email => current_user.email)
+ flash[:notice] = I18n.t("users.confirm_email.email_confirmed", email: current_user.email)
elsif current_user.unconfirmed_email.present?
- flash[:error] = I18n.t('users.confirm_email.email_not_confirmed')
+ flash[:error] = I18n.t("users.confirm_email.email_not_confirmed")
end
redirect_to edit_user_path
end