pretty_date(None) now returns None

This commit is contained in:
2016-11-08 12:56:19 +01:00
parent fb6e326a14
commit 65b554986c
3 changed files with 17 additions and 7 deletions

View File

@@ -1,7 +1,6 @@
import logging
import warnings
import flask
from flask import current_app
from flask import request
from flask import jsonify
@@ -14,7 +13,7 @@ import werkzeug.exceptions as wz_exceptions
from pillar.web import subquery
from pillar.web.nodes.routes import blueprint
from pillar.web.utils import gravatar
from pillar.web.utils import pretty_date
from pillar.web.utils import pretty_date, datetime_now
from pillar.web.utils import system_util
log = logging.getLogger(__name__)
@@ -112,7 +111,7 @@ def format_comment(comment, is_reply=False, is_team=False, replies=None):
return dict(_id=comment._id,
gravatar=gravatar(comment.user.email, size=32),
time_published=pretty_date(comment._created, detail=True),
time_published=pretty_date(comment._created or datetime_now(), detail=True),
rating=comment.properties.rating_positive - comment.properties.rating_negative,
author=comment.user.full_name,
author_username=comment.user.username,