From 62fb9c13d871624c345a969a5e97525a8d554bee Mon Sep 17 00:00:00 2001 From: Stefan Melmuk Date: Sun, 15 Sep 2024 03:44:39 +0200 Subject: [PATCH] rename policy check --- src/api/core/accounts.rs | 2 +- src/db/models/org_policy.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/core/accounts.rs b/src/api/core/accounts.rs index cc9cd6ce769..fc33619d339 100644 --- a/src/api/core/accounts.rs +++ b/src/api/core/accounts.rs @@ -112,7 +112,7 @@ async fn is_email_2fa_required(org_user_uuid: Option, conn: &mut DbConn) return true; } if org_user_uuid.is_some() { - return OrgPolicy::is_enabled_by_org(&org_user_uuid.unwrap(), OrgPolicyType::TwoFactorAuthentication, conn) + return OrgPolicy::is_enabled_for_member(&org_user_uuid.unwrap(), OrgPolicyType::TwoFactorAuthentication, conn) .await; } false diff --git a/src/db/models/org_policy.rs b/src/db/models/org_policy.rs index 277da4f151e..23e583b4085 100644 --- a/src/db/models/org_policy.rs +++ b/src/db/models/org_policy.rs @@ -342,7 +342,7 @@ impl OrgPolicy { false } - pub async fn is_enabled_by_org(org_user_uuid: &str, policy_type: OrgPolicyType, conn: &mut DbConn) -> bool { + pub async fn is_enabled_for_member(org_user_uuid: &str, policy_type: OrgPolicyType, conn: &mut DbConn) -> bool { if let Some(membership) = UserOrganization::find_by_uuid(org_user_uuid, conn).await { if let Some(policy) = OrgPolicy::find_by_org_and_type(&membership.org_uuid, policy_type, conn).await { return policy.enabled;