diff options
author | Marius Balteanu <marius.balteanu@zitec.com> | 2022-01-29 09:43:46 +0000 |
---|---|---|
committer | Marius Balteanu <marius.balteanu@zitec.com> | 2022-01-29 09:43:46 +0000 |
commit | 972edf78cc3e4eb02009cf78350b4a734a5c95cb (patch) | |
tree | 30860745977a38497cfb27c51d41c1aab9e7002f /app | |
parent | 146097c6108813520fca703cf072914c8f032c00 (diff) | |
download | redmine-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.rb | 8 |
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 |