Ensure errors display when updating profile images

This commit is contained in:
Karina Kwiatek 2023-12-17 22:58:25 +01:00
parent 2721e050c6
commit 4df74d6ff5

View file

@ -12,9 +12,10 @@ class Settings::ProfilePictureController < ApplicationController
text += t(".notice.profile_header") if user_attributes[:profile_header]
flash[:success] = text
else
flash[:error] = t(".error")
# CarrierWave resets the image to the default upon an error
current_user.reload
end
redirect_to settings_profile_path
render "settings/profile/edit"
end
end