diff --git a/src/api/admin.rs b/src/api/admin.rs index b3cda21..c4fad11 100644 --- a/src/api/admin.rs +++ b/src/api/admin.rs @@ -153,10 +153,6 @@ fn invite_user(data: Json, _token: AdminToken, conn: DbConn) -> Empt err!("User already exists") } - if !CONFIG.invitations_allowed() { - err!("Invitations are not allowed") - } - let mut user = User::new(email); user.save(&conn)?; diff --git a/src/db/models/user.rs b/src/db/models/user.rs index 9646ae5..3a6e95d 100644 --- 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, + } } }