From: hernani Date: Wed, 7 Jul 2010 12:54:22 +0000 (+0000) Subject: Fixes OSQA 348, Last seen field is not updated. X-Git-Tag: live~636 X-Git-Url: https://git.openstreetmap.org./osqa.git/commitdiff_plain/970b17e67841daa480973c8bdad6d21168b0525d Fixes OSQA 348, Last seen field is not updated. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@498 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- diff --git a/forum/models/user.py b/forum/models/user.py index 7f1df5f..34c6b36 100644 --- a/forum/models/user.py +++ b/forum/models/user.py @@ -151,6 +151,10 @@ class User(BaseModel, DjangoUser): return self.username + @property + def last_activity(self): + return self.actions.order_by('-action_date')[0].action_date + @property def gravatar(self): return md5(self.email).hexdigest() diff --git a/forum/skins/default/templates/users/info.html b/forum/skins/default/templates/users/info.html index e14cbf8..efc49fd 100644 --- a/forum/skins/default/templates/users/info.html +++ b/forum/skins/default/templates/users/info.html @@ -51,7 +51,7 @@ {% if view_user.last_seen %} {% trans "last seen" %} - {% diff_date view_user.last_login %} + {% diff_date view_user.last_activity %} {% endif %} {% if view_user.website %}