瀏覽代碼

[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: