vw_small

Hardened fork of Vaultwarden (https://github.com/dani-garcia/vaultwarden) with fewer features.
git clone https://git.philomathiclife.com/repos/vw_small
Log | Files | Refs | README

commit 03233429f4475de558c58707224d1cf72aa28c42
parent 0a72c4b6db4e254d7579b8dc3bb6e9e3c067947d
Author: Miro Prasil <miro@circleci.com>
Date:   Sun, 16 Feb 2020 20:28:50 +0000

Remove check from Invitation:take()

I've checked the spots when `Invitation::new()` and `Invitation::take()`
are used and it seems like all spots are already correctly gated. So to
enable invitations via admin API even when invitations are otherwise
disabled, this check can be removed.

Diffstat:
Msrc/db/models/user.rs | 9++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/db/models/user.rs b/src/db/models/user.rs @@ -319,10 +319,9 @@ impl Invitation { } pub fn take(mail: &str, conn: &DbConn) -> bool { - CONFIG.invitations_allowed() - && match Self::find_by_mail(mail, &conn) { - Some(invitation) => invitation.delete(&conn).is_ok(), - None => false, - } + match Self::find_by_mail(mail, &conn) { + Some(invitation) => invitation.delete(&conn).is_ok(), + None => false, + } } }