Преглед на файлове

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