]> git.openstreetmap.org Git - osqa.git/commitdiff
Fixes OSQA 348, Last seen field is not updated.
authorhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Wed, 7 Jul 2010 12:54:22 +0000 (12:54 +0000)
committerhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Wed, 7 Jul 2010 12:54:22 +0000 (12:54 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@498 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/models/user.py
forum/skins/default/templates/users/info.html

index 7f1df5f65598ed958d762d6356eaf259b9c05f2c..34c6b36f39d79db7af39dc55e6e1d2a206fec3ba 100644 (file)
@@ -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()
index e14cbf8adc694c03b5d1ff6723fa963985620120..efc49fdebd6295488db45a8f920c1f0bd46e54be 100644 (file)
@@ -51,7 +51,7 @@
                 {% if view_user.last_seen %}
                 <tr>
                     <td>{% trans "last seen" %}</td>
-                    <td><strong title="{{ view_user.last_login }}">{% diff_date view_user.last_login %}</strong></td>
+                    <td><strong title="{{ view_user.last_activity }}">{% diff_date view_user.last_activity %}</strong></td>
                 </tr>
                 {% endif %}
                 {% if view_user.website %}