forum: fix edit timestamp recording + display
On the preproduction server there are messages that have an edit timestamp some 20 ns after their creation, for some reason.
This commit is contained in:
parent
c26861527b
commit
85323e896d
|
@ -26,7 +26,7 @@ def edit_post(postid):
|
|||
|
||||
p = Post.query.filter_by(id=postid).first_or_404()
|
||||
|
||||
# Check permissions. TODO: Allow guests to edit their posts?
|
||||
# Check permissions
|
||||
if not current_user.can_edit_post(p):
|
||||
abort(403)
|
||||
|
||||
|
@ -68,6 +68,7 @@ def edit_post(postid):
|
|||
attachments.append((a, file))
|
||||
db.session.add(a)
|
||||
|
||||
comment.touch()
|
||||
db.session.add(comment)
|
||||
|
||||
if isinstance(p, Topic):
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
<td class="message">
|
||||
<div class="info">
|
||||
<div>Posté le <a href="{{ request.path }}#{{ c.id }}">{{ c.date_created | dyndate }}</a></div>
|
||||
{% if c.date_created != c.date_modified %}
|
||||
{% if (c.date_modified - c.date_created).seconds > 120 %}
|
||||
<div>Modifié le <a href="{{ request.path }}#{{ c.id }}">{{ c.date_modified | dyndate }}</a></div>
|
||||
{% endif %}
|
||||
{{ post_actions(c) }}
|
||||
|
|
Loading…
Reference in New Issue