Skip to content

Commit

Permalink
Add last_active_at column to users page (re getredash#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
alison985 authored and Allen Short committed Jan 8, 2018
1 parent 232dd84 commit 7596cd3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client/app/pages/users/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<tr>
<th>Name</th>
<th>Joined</th>
<th>Last Active At</th>
</tr>
</thead>
<tbody>
Expand All @@ -20,6 +21,9 @@
<td>
<span am-time-ago="row.created_at"></span>
</td>
<td>
<span>{{ row.last_active_at[0] }}</span>
</td>
</tr>
</tbody>
</table>
Expand Down
2 changes: 2 additions & 0 deletions redash/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 7596cd3

Please sign in to comment.