Skip to content

Commit

Permalink
Add last_active_at column to users page (re #155)
Browse files Browse the repository at this point in the history
  • Loading branch information
alison985 authored and Allen Short committed Jul 25, 2018
1 parent f601211 commit 54637db
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client/app/pages/users/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<tr>
<th>Name</th>
<th>Joined</th>
<th>Last Active At</th>
<th width="1%"></th>
</tr>
</thead>
Expand All @@ -35,10 +36,13 @@
<button type="button" class="btn btn-default" ng-if="!user.is_disabled" ng-click="$ctrl.disableUser(user)">Disable</button>
</div>
</td>
<td>
<span>{{ row.last_active_at[0] }}</span>
</td>
</tr>
</tbody>
</table>
<paginator paginator="$ctrl.users"></paginator>
</div>
</div>
</settings-screen>
</settings-screen>
2 changes: 2 additions & 0 deletions redash/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,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 54637db

Please sign in to comment.