mirror of
https://github.com/discourse/discourse.git
synced 2025-10-03 17:21:20 +08:00
stree
This commit is contained in:
parent
ff2434928e
commit
f721886da3
5 changed files with 6 additions and 19 deletions
|
@ -459,10 +459,7 @@ class InvitesController < ApplicationController
|
|||
return render_json_error(I18n.t("rate_limiter.slow_down"))
|
||||
end
|
||||
|
||||
Invite
|
||||
.pending(current_user)
|
||||
.where.not(email: nil)
|
||||
.find_each { |invite| invite.resend_invite }
|
||||
Invite.pending(current_user).where.not(email: nil).find_each { |invite| invite.resend_invite }
|
||||
|
||||
render json: success_json
|
||||
end
|
||||
|
|
|
@ -190,14 +190,10 @@ class DiscourseConnect < DiscourseConnectBase
|
|||
desired_groups = Group.where("LOWER(NAME) in (?) AND NOT automatic", names)
|
||||
|
||||
to_be_added = desired_groups
|
||||
if current_groups.present?
|
||||
to_be_added = to_be_added.where.not(id: current_groups.map(&:id))
|
||||
end
|
||||
to_be_added = to_be_added.where.not(id: current_groups.map(&:id)) if current_groups.present?
|
||||
|
||||
to_be_removed = current_groups
|
||||
if desired_groups.present?
|
||||
to_be_removed = to_be_removed.where.not(id: desired_groups.map(&:id))
|
||||
end
|
||||
to_be_removed = to_be_removed.where.not(id: desired_groups.map(&:id)) if desired_groups.present?
|
||||
|
||||
if to_be_added.present? || to_be_removed.present?
|
||||
GroupUser.transaction do
|
||||
|
|
|
@ -308,9 +308,7 @@ class Notification < ActiveRecord::Base
|
|||
[
|
||||
Notification.types[:liked],
|
||||
Notification.types[:liked_consolidated],
|
||||
].each do |notification_type|
|
||||
notifications = notifications.where.not(notification_type:)
|
||||
end
|
||||
].each { |notification_type| notifications = notifications.where.not(notification_type:) }
|
||||
end
|
||||
|
||||
notifications = notifications.to_a
|
||||
|
|
|
@ -37,9 +37,7 @@ DiscourseAutomation::Scriptable.add(
|
|||
|
||||
category_users = []
|
||||
existing_users =
|
||||
CategoryUser
|
||||
.where(category_id:, user_id: user_ids)
|
||||
.where.not(notification_level: nil)
|
||||
CategoryUser.where(category_id:, user_id: user_ids).where.not(notification_level: nil)
|
||||
skip_user_ids = existing_users.pluck(:user_id)
|
||||
|
||||
batch.each do |group_user|
|
||||
|
|
|
@ -19,9 +19,7 @@ module Chat
|
|||
return false if post.topic.private_message?
|
||||
|
||||
quoted_users = extract_quoted_users(post)
|
||||
if @notified_users.present?
|
||||
quoted_users = quoted_users.where.not(id: @notified_users)
|
||||
end
|
||||
quoted_users = quoted_users.where.not(id: @notified_users) if @notified_users.present?
|
||||
|
||||
opts = { user_id: post.user.id, display_username: post.user.username }
|
||||
quoted_users.each do |user|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue