]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/models/user.py
Fixes a bug where the profile page of users with now actions could explode.
[osqa.git] / forum / models / user.py
index 5aa8cc8ef1f95a66413ae9c4457c95495c1f40d5..b18047e9295ccb208b18293cad1c188ef12e7bc6 100644 (file)
@@ -156,7 +156,10 @@ class User(BaseModel, DjangoUser):
 
     @property
     def last_activity(self):
-        return self.actions.order_by('-action_date')[0].action_date
+        try:
+            return self.actions.order_by('-action_date')[0].action_date
+        except:
+            return None
 
     @property
     def gravatar(self):