From cee3fd5ba284f376cd05755dbc9cd6b7ded297ed Mon Sep 17 00:00:00 2001 From: Jeremy Lin Date: Tue, 19 Oct 2021 01:27:50 -0700 Subject: Emergency Access cleanup This commit contains mostly superficial user-facing cleanup, to be followed up with more extensive cleanup and fixes in the API implementation. --- src/api/core/accounts.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/api/core/accounts.rs') diff --git a/src/api/core/accounts.rs b/src/api/core/accounts.rs index 4e613a37..93636889 100644 --- a/src/api/core/accounts.rs +++ b/src/api/core/accounts.rs @@ -91,10 +91,9 @@ fn register(data: JsonUpcase, conn: DbConn) -> EmptyResult { user } else if CONFIG.is_signup_allowed(&email) { // check if it's invited by emergency contact - if EmergencyAccess::find_invited_by_grantee_email(&data.Email, &conn).is_some() { - user - } else { - err!("Account with this email already exists") + match EmergencyAccess::find_invited_by_grantee_email(&data.Email, &conn) { + Some(_) => user, + _ => err!("Account with this email already exists"), } } else { err!("Registration not allowed or user already exists") -- cgit v1.2.3