aboutsummaryrefslogtreecommitdiff
path: root/src/api/core/accounts.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/core/accounts.rs')
-rw-r--r--src/api/core/accounts.rs7
1 files changed, 3 insertions, 4 deletions
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<RegisterData>, 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")