Commit 2e6f681a authored by Eugen Rochko's avatar Eugen Rochko

Fix error in follow_all

parent 6282234f
Pipeline #165 passed with stages
in 4 minutes and 32 seconds
...@@ -28,9 +28,9 @@ class FriendsController < ApplicationController ...@@ -28,9 +28,9 @@ class FriendsController < ApplicationController
def follow_all def follow_all
if Sidekiq::Status.complete?(job_id) if Sidekiq::Status.complete?(job_id)
friends = self.friends loaded_friends = friends
friends.each do |friend| loaded_friends.each do |friend|
next if friend.relative_account_id.blank? || friend.following next if friend.relative_account_id.blank? || friend.following
begin begin
...@@ -41,7 +41,7 @@ class FriendsController < ApplicationController ...@@ -41,7 +41,7 @@ class FriendsController < ApplicationController
end end
end end
Rails.cache.write("#{current_user.id}/friends", friends.map { |f| [f.id, f.relative_account_id, f.following] }) Rails.cache.write("#{current_user.id}/friends", loaded_friends.map { |f| [f.id, f.relative_account_id, f.following] })
end end
redirect_to friends_path redirect_to friends_path
......
...@@ -9,11 +9,11 @@ class UserSerializer < ActiveModel::Serializer ...@@ -9,11 +9,11 @@ class UserSerializer < ActiveModel::Serializer
end end
def mastodon_username def mastodon_username
object.mastodon.uid object.mastodon&.uid || ''
end end
def twitter_username def twitter_username
object.twitter.display_name object.twitter&.display_name || ''
end end
def display_name def display_name
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment