Ensure errors display when updating profile images
This commit is contained in:
parent
2721e050c6
commit
4df74d6ff5
|
@ -12,9 +12,10 @@ class Settings::ProfilePictureController < ApplicationController
|
||||||
text += t(".notice.profile_header") if user_attributes[:profile_header]
|
text += t(".notice.profile_header") if user_attributes[:profile_header]
|
||||||
flash[:success] = text
|
flash[:success] = text
|
||||||
else
|
else
|
||||||
flash[:error] = t(".error")
|
# CarrierWave resets the image to the default upon an error
|
||||||
|
current_user.reload
|
||||||
end
|
end
|
||||||
|
|
||||||
redirect_to settings_profile_path
|
render "settings/profile/edit"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue