Show latest active device as last active on admin page

This commit is contained in:
janost committed 2020-12-03 17:07:32 +01:00
1 parent 9824d94a1c
commit 1eb5495802
4 files changed
+25

No files matched your search

+7
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 {