You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
715 B

  1. # frozen_string_literal: true
  2. class Settings::ProfilesController < Settings::BaseController
  3. include ObfuscateFilename
  4. before_action :set_account
  5. obfuscate_filename [:account, :avatar]
  6. obfuscate_filename [:account, :header]
  7. def show; end
  8. def update
  9. if UpdateAccountService.new.call(@account, account_params)
  10. ActivityPub::UpdateDistributionWorker.perform_async(@account.id)
  11. redirect_to settings_profile_path, notice: I18n.t('generic.changes_saved_msg')
  12. else
  13. render :show
  14. end
  15. end
  16. private
  17. def account_params
  18. params.require(:account).permit(:display_name, :note, :avatar, :header, :locked)
  19. end
  20. def set_account
  21. @account = current_user.account
  22. end
  23. end