Skip to content

Commit 3f31b63

Browse files
committed
Merge pull request #88 from mozillazg/comment
change the default value of Comment.created_at from now to utcnow
2 parents f54f359 + 0463a6a commit 3f31b63

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

firefly/models/topic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class Quote(Post):
9898

9999
class Comment(db.Document):
100100
id = db.SequenceField(primary_key=True)
101-
created_at = db.DateTimeField(default=datetime.now, required=True)
101+
created_at = db.DateTimeField(default=datetime.utcnow, required=True)
102102
content = db.StringField(verbose_name='Comment', required=True)
103103
author = db.ReferenceField(User)
104104
ref_id = db.IntField(default=0)

firefly/templates/posts/detail.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757
co-founder
5858
div.post-info
5959
a.post-date href="/t/quickly-tell-someone-why-they-should-look-at-a-topic/27503/2" data-bindattr-1516="1516"
60-
span.relative-date title="${post.created_at.strftime('%c %p')}" data-time="1428885788713" data-format="tiny"
61-
${short_timesince(post.created_at)}
60+
span.relative-date title="${p.created_at.strftime('%c %p')}" data-time="1428885788713" data-format="tiny"
61+
${short_timesince(p.created_at)}
6262
div.contents.regular
6363
div.cooked
6464
- if p.content

0 commit comments

Comments
 (0)