mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 23:38:29 +08:00
DEV: Use staged user check instead (#24578)
This change refactors the check `user.groups.any?` and instead uses `user.staged?` to check if the user is staged or not. Also fixes several tests to ensure the users have their auto trust level groups created. Follow up to: - 8a45f84277e6e13bc48b8f4e40350a9cbd5cd2ee - 447d9b210556e64c14f9ca9f8f9b52f54090cd41 - c89edd9e86870f97a770816210d71400f09181f2
This commit is contained in:
@ -859,7 +859,7 @@ module Email
|
||||
|
||||
user ||= stage_from_user
|
||||
|
||||
if user.groups.any? && !user.in_any_groups?(SiteSetting.email_in_allowed_groups_map) &&
|
||||
if !user.staged? && !user.in_any_groups?(SiteSetting.email_in_allowed_groups_map) &&
|
||||
!sent_to_mailinglist_mirror?
|
||||
raise InsufficientTrustLevelError
|
||||
end
|
||||
|
Reference in New Issue
Block a user