Add a fqn field to blogs and users (#457)

Fixes #319
This commit is contained in:
Baptiste Gelez
2019-03-06 18:28:10 +01:00
committed by GitHub
parent eff2698664
commit fe6e69d7c4
39 changed files with 258 additions and 141 deletions
+1 -1
View File
@@ -40,7 +40,7 @@ pub struct LoginForm {
#[post("/login", data = "<form>")]
pub fn create(conn: DbConn, form: LenientForm<LoginForm>, flash: Option<FlashMessage>, mut cookies: Cookies, intl: I18n) -> Result<Redirect, Ructe> {
let user = User::find_by_email(&*conn, &form.email_or_name)
.or_else(|_| User::find_local(&*conn, &form.email_or_name));
.or_else(|_| User::find_by_fqn(&*conn, &form.email_or_name));
let mut errors = match form.validate() {
Ok(_) => ValidationErrors::new(),
Err(e) => e