[stick to master] Re-enable stick to master for media attachments, enable stick to master for user sessions

This commit is contained in:
Fosco Marotto 2020-12-27 01:57:18 -05:00
parent 91c1b769c3
commit 2b3c571422
2 changed files with 2 additions and 1 deletions

View File

@ -36,6 +36,7 @@ class Auth::SessionsController < Devise::SessionsController
protected
def find_user
User.connection.stick_to_master!
if session[:otp_user_id]
User.find(session[:otp_user_id])
elsif user_params[:email]

View File

@ -151,7 +151,7 @@ class PostStatusService < BaseService
raise GabSocial::ValidationError, I18n.t('media_attachments.validations.too_many') if @options[:media_ids].size > 4 || @options[:poll].present?
# @account.media_attachments.connection.stick_to_master!
@account.media_attachments.connection.stick_to_master!
@media = @account.media_attachments.where(status_id: nil).where(id: @options[:media_ids].take(4).map(&:to_i))
hasVideoOrGif = @media.find(&:video?) || @media.find(&:gifv?)