Spiegel von
https://github.com/dani-garcia/vaultwarden.git
synchronisiert 2024-11-22 05:10:29 +01:00
Implement update_revision trigger
Dieser Commit ist enthalten in:
Ursprung
b5a057f063
Commit
3f5a99916a
2 geänderte Dateien mit 15 neuen und 1 gelöschten Zeilen
|
@ -242,7 +242,11 @@ fn post_ciphers_import(data: JsonUpcase<ImportData>, headers: Headers, conn: DbC
|
||||||
cipher.move_to_folder(folder_uuid, &headers.user.uuid.clone(), &conn).ok();
|
cipher.move_to_folder(folder_uuid, &headers.user.uuid.clone(), &conn).ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
let mut user = headers.user;
|
||||||
|
match user.update_revision(&conn) {
|
||||||
|
Ok(()) => Ok(()),
|
||||||
|
Err(_) => err!("Failed to update the revision, please log out and log back in to finish import.")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[post("/ciphers/<uuid>/admin", data = "<data>")]
|
#[post("/ciphers/<uuid>/admin", data = "<data>")]
|
||||||
|
|
|
@ -154,6 +154,16 @@ impl User {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn update_revision(&mut self, conn: &DbConn) -> QueryResult<()> {
|
||||||
|
diesel::update(
|
||||||
|
users::table.filter(
|
||||||
|
users::uuid.eq(&self.uuid)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.set(users::updated_at.eq(Utc::now().naive_utc()))
|
||||||
|
.execute(&**conn).and(Ok(()))
|
||||||
|
}
|
||||||
|
|
||||||
pub fn find_by_mail(mail: &str, conn: &DbConn) -> Option<Self> {
|
pub fn find_by_mail(mail: &str, conn: &DbConn) -> Option<Self> {
|
||||||
let lower_mail = mail.to_lowercase();
|
let lower_mail = mail.to_lowercase();
|
||||||
users::table
|
users::table
|
||||||
|
|
Laden …
In neuem Issue referenzieren