Nick Fox
6 years ago
No known key found for this signature in database
GPG Key ID: 82719985805A7CA8
1 changed files with
2 additions and
2 deletions
-
src/api/core/accounts.rs
|
@ -59,7 +59,7 @@ fn register(data: JsonUpcase<RegisterData>, conn: DbConn) -> EmptyResult { |
|
|
|
|
|
|
|
|
let mut user = match User::find_by_mail(&data.Email, &conn) { |
|
|
let mut user = match User::find_by_mail(&data.Email, &conn) { |
|
|
Some(user) => { |
|
|
Some(user) => { |
|
|
if !CONFIG.email_invitations { |
|
|
if CONFIG.mail.is_none() { |
|
|
if Invitation::take(&data.Email, &conn) { |
|
|
if Invitation::take(&data.Email, &conn) { |
|
|
for mut user_org in UserOrganization::find_invited_by_user(&user.uuid, &conn).iter_mut() { |
|
|
for mut user_org in UserOrganization::find_invited_by_user(&user.uuid, &conn).iter_mut() { |
|
|
user_org.status = UserOrgStatus::Accepted as i32; |
|
|
user_org.status = UserOrgStatus::Accepted as i32; |
|
@ -79,7 +79,7 @@ fn register(data: JsonUpcase<RegisterData>, conn: DbConn) -> EmptyResult { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
None => { |
|
|
None => { |
|
|
if CONFIG.signups_allowed || (!CONFIG.email_invitations && Invitation::take(&data.Email, &conn)) { |
|
|
if CONFIG.signups_allowed || (CONFIG.mail.is_none() && Invitation::take(&data.Email, &conn)) { |
|
|
User::new(data.Email) |
|
|
User::new(data.Email) |
|
|
} else { |
|
|
} else { |
|
|
err!("Registration not allowed") |
|
|
err!("Registration not allowed") |
|
|