[PATCH] utils: return 'never' when the age is None

Andrew Shadura andrew at shadura.me
Thu May 21 14:15:41 EDT 2015


# HG changeset patch
# User Andrew Shadura <andrew at shadura.me>
# Date 1432232093 -7200
#      Thu May 21 20:14:53 2015 +0200
# Node ID 3737e67c7cbb89750dd8b3b5f76a003678792f3f
# Parent  8d43a8174c960779437c2d8de7a0906a8cd14128
utils: return 'never' when the age is None

diff --git a/kallithea/lib/utils2.py b/kallithea/lib/utils2.py
--- a/kallithea/lib/utils2.py
+++ b/kallithea/lib/utils2.py
@@ -371,6 +371,9 @@ def age(prevdate, show_short_version=Fal
     deltas = {}
     future = False
 
+    if prevdate is None:
+        return _(u'never')
+
     if prevdate > now:
         now, prevdate = prevdate, now
         future = True


More information about the kallithea-general mailing list