]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/models/user.py
Avoids a strange error probably coming from either django or python.
[osqa.git] / forum / models / user.py
index 2e71868d8d1333f19a1a27bfd929d515606aeecc..fb13c27f7c5524c27b2aaa544d207f76ac978a97 100644 (file)
@@ -315,7 +315,7 @@ class User(BaseModel, DjangoUser):
             return self.can_delete_comment(post)
 
         return (self == post.author and (post.__class__.__name__ == "Answer" or
-        not post.answers.exclude(author=self).count()))
+        not post.answers.exclude(author__id=self.id).count()))
 
     @true_if_is_super_or_staff
     def can_upload_files(self):