2020-10-15 12:09:06 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class DisallowTwoFactorForGroupWorker
|
|
|
|
include ApplicationWorker
|
2021-04-30 18:10:09 +00:00
|
|
|
|
2021-07-21 12:09:35 +00:00
|
|
|
data_consistency :always
|
|
|
|
|
2021-04-30 18:10:09 +00:00
|
|
|
sidekiq_options retry: 3
|
2020-10-15 12:09:06 +00:00
|
|
|
include ExceptionBacktrace
|
|
|
|
|
|
|
|
feature_category :subgroups
|
|
|
|
idempotent!
|
|
|
|
|
|
|
|
def perform(group_id)
|
|
|
|
begin
|
|
|
|
group = Group.find(group_id)
|
|
|
|
rescue ActiveRecord::RecordNotFound
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
group.update!(require_two_factor_authentication: false)
|
|
|
|
end
|
|
|
|
end
|