summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2022-01-29 09:43:46 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2022-01-29 09:43:46 +0000
commit972edf78cc3e4eb02009cf78350b4a734a5c95cb (patch)
tree30860745977a38497cfb27c51d41c1aab9e7002f /app
parent146097c6108813520fca703cf072914c8f032c00 (diff)
downloadredmine-972edf78cc3e4eb02009cf78350b4a734a5c95cb.tar.gz
redmine-972edf78cc3e4eb02009cf78350b4a734a5c95cb.zip
Improve readability of @must_activate_twofa?@ function (#31920).
git-svn-id: http://svn.redmine.org/redmine/trunk@21389 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/models/user.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 8c190374f..7cdfa1dbd 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -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