1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-01-31 11:37:14 +00:00

Improve readability of @must_activate_twofa?@ function (#31920).

git-svn-id: http://svn.redmine.org/redmine/trunk@21389 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Marius Balteanu 2022-01-29 09:43:46 +00:00
parent 146097c610
commit 972edf78cc

View File

@ -384,10 +384,10 @@ class User < Principal
end
def must_activate_twofa?
(
Setting.twofa_required? ||
(Setting.twofa_optional? && groups.any?(&:twofa_required?))
) && !twofa_active?
return false if twofa_active?
return true if Setting.twofa_required?
return true if Setting.twofa_optional? && groups.any?(&:twofa_required?)
end
def pref