diff options
author | Mathijs van Veluw <[email protected]> | 2024-01-01 15:42:57 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2024-01-01 15:42:57 +0100 |
commit | 76a3f0f531ef0b28b1dc1aefe276a0863f7bbd6d (patch) | |
tree | 543a42b0492fbec0789b9dbd1fa2a2b59cd20f56 /src | |
parent | c5665e7b7767236923a1712fa14ad2d249408379 (diff) | |
download | vaultwarden-76a3f0f531ef0b28b1dc1aefe276a0863f7bbd6d.tar.gz vaultwarden-76a3f0f531ef0b28b1dc1aefe276a0863f7bbd6d.zip |
Fix Single Org Policy check (#4207)
There was an error in the single org policy check to determine how many
users there are in an org. The `or` check was at the wrong location in
the DSL.
This is now fixed.
Fixes #4205
Diffstat (limited to 'src')
-rw-r--r-- | src/db/models/organization.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/db/models/organization.rs b/src/db/models/organization.rs index 620d7428..9c908193 100644 --- a/src/db/models/organization.rs +++ b/src/db/models/organization.rs @@ -648,8 +648,7 @@ impl UserOrganization { db_run! { conn: { users_organizations::table .filter(users_organizations::user_uuid.eq(user_uuid)) - .filter(users_organizations::status.eq(UserOrgStatus::Accepted as i32)) - .or_filter(users_organizations::status.eq(UserOrgStatus::Confirmed as i32)) + .filter(users_organizations::status.eq(UserOrgStatus::Accepted as i32).or(users_organizations::status.eq(UserOrgStatus::Confirmed as i32))) .count() .first::<i64>(conn) .unwrap_or(0) |