From facde93c4df94be5d2eafd1d79f17e111a9e9e76 Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Wed, 6 Nov 2019 00:44:37 -0600 Subject: clear formatter cache when profile is changed --- app/controllers/settings/profiles_controller.rb | 2 ++ app/services/activitypub/process_account_service.rb | 2 ++ 2 files changed, 4 insertions(+) diff --git a/app/controllers/settings/profiles_controller.rb b/app/controllers/settings/profiles_controller.rb index afd525cc0..f9008727e 100644 --- a/app/controllers/settings/profiles_controller.rb +++ b/app/controllers/settings/profiles_controller.rb @@ -13,6 +13,8 @@ class Settings::ProfilesController < Settings::BaseController end def update + Rails.cache.delete("formatted_account:#{@account.id}") + if UpdateAccountService.new.call(@account, account_params) ActivityPub::UpdateDistributionWorker.perform_async(@account.id) redirect_to settings_profile_path, notice: I18n.t('generic.changes_saved_msg') diff --git a/app/services/activitypub/process_account_service.rb b/app/services/activitypub/process_account_service.rb index a1d508405..21f326988 100644 --- a/app/services/activitypub/process_account_service.rb +++ b/app/services/activitypub/process_account_service.rb @@ -68,6 +68,8 @@ class ActivityPub::ProcessAccountService < BaseService set_immediate_attributes! set_fetchable_attributes! unless @options[:only_keys] + Rails.cache.delete("formatted_account:#{@account.id}") + @account.save_with_optional_media! end -- cgit