소스 검색

[pelican_comment_system] Fix comparison of offset-naive and offset-aware datetimes

The direct `date` attribute of a Content object has always a timezone.

Fixes #721
Bernhard Scheirle 8 년 전
부모
커밋
89ca956998
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      pelican_comment_system/comment.py

+ 1 - 1
pelican_comment_system/comment.py

@@ -52,7 +52,7 @@ class Comment(Content):
         return None
 
     def __lt__(self, other):
-        return self.metadata['date'] < other.metadata['date']
+        return self.date < other.date
 
     def sortReplies(self):
         for r in self.replies: