From f2757d1b6f0f32e719f45430b50191a4ef8a27f1 Mon Sep 17 00:00:00 2001 From: Alison Date: Fri, 11 Aug 2017 20:36:18 -0500 Subject: [PATCH] Add last_active_at column to users page (re #155) --- client/app/pages/users/list.html | 4 ++++ redash/models.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/client/app/pages/users/list.html b/client/app/pages/users/list.html index 301c920be4..513a86b0de 100644 --- a/client/app/pages/users/list.html +++ b/client/app/pages/users/list.html @@ -10,6 +10,7 @@ Name Joined + Last Active At @@ -20,6 +21,9 @@ + + {{ row.last_active_at[0] }} + diff --git a/redash/models.py b/redash/models.py index c74475ed0b..b17f99cd58 100644 --- a/redash/models.py +++ b/redash/models.py @@ -432,6 +432,8 @@ def to_dict(self, with_api_key=False): if with_api_key: d['api_key'] = self.api_key + d['last_active_at'] = Event.query.filter(Event.user_id == self.id).with_entities(Event.created_at).order_by(Event.created_at.desc()).first() + return d def is_api_user(self):