Show More
@@ -137,8 +137,7 b' class AdminUsersView(BaseAppView):' | |||
|
137 | 137 | "first_name": h.escape(user.name), |
|
138 | 138 | "last_name": h.escape(user.lastname), |
|
139 | 139 | "last_login": h.format_date(user.last_login), |
|
140 | "last_activity": h.format_date( | |
|
141 | h.time_to_datetime(user.user_data.get('last_activity', 0))), | |
|
140 | "last_activity": h.format_date(user.last_activity), | |
|
142 | 141 | "active": h.bool2icon(user.active), |
|
143 | 142 | "active_raw": user.active, |
|
144 | 143 | "admin": h.bool2icon(user.admin), |
@@ -846,12 +846,9 b' class User(Base, BaseModel):' | |||
|
846 | 846 | |
|
847 | 847 | def update_lastactivity(self): |
|
848 | 848 | """Update user lastactivity""" |
|
849 | usr = self | |
|
850 | old = usr.user_data | |
|
851 | old.update({'last_activity': time.time()}) | |
|
852 | usr.user_data = old | |
|
853 | Session().add(usr) | |
|
854 | log.debug('updated user %s lastactivity', usr.username) | |
|
849 | self.last_activity = datetime.datetime.now() | |
|
850 | Session().add(self) | |
|
851 | log.debug('updated user %s lastactivity', self.username) | |
|
855 | 852 | |
|
856 | 853 | def update_password(self, new_password): |
|
857 | 854 | from rhodecode.lib.auth import get_crypt_password |
@@ -6,7 +6,7 b'' | |||
|
6 | 6 | (_('Source of Record'), c.user.extern_type, '', ''), |
|
7 | 7 | |
|
8 | 8 | (_('Last login'), c.user.last_login or '-', '', ''), |
|
9 |
(_('Last activity'), |
|
|
9 | (_('Last activity'), c.user.last_activity, '', ''), | |
|
10 | 10 | |
|
11 | 11 | (_('Repositories'), len(c.user.repositories), '', [x.repo_name for x in c.user.repositories]), |
|
12 | 12 | (_('Repository groups'), len(c.user.repository_groups), '', [x.group_name for x in c.user.repository_groups]), |
General Comments 0
You need to be logged in to leave comments.
Login now