Show latest active device as last active on admin page

This commit is contained in:
janost
2020-11-30 22:00:51 +01:00
parent 9824d94a1c
commit 1eb5495802
4 changed files with 25 additions and 0 deletions

View File

@@ -288,6 +288,13 @@ impl User {
users::table.load::<UserDb>(conn).expect("Error loading users").from_db()
}}
}
pub fn last_active(&self, conn: &DbConn) -> Option<NaiveDateTime> {
match Device::find_latest_active_by_user(&self.uuid, conn) {
Some(device) => Some(device.updated_at),
None => None
}
}
}
impl Invitation {