changeset 8067:85e34d874a1e

lib: avoid comparing ordering with None Fails in py3.
author Mads Kiilerich <mads@kiilerich.com>
date Thu, 26 Dec 2019 04:05:14 +0100
parents d9d03f138cc3
children c82ef5ec8dcd
files kallithea/lib/celerylib/tasks.py
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/lib/celerylib/tasks.py	Thu Dec 26 11:52:58 2019 +0100
+++ b/kallithea/lib/celerylib/tasks.py	Thu Dec 26 04:05:14 2019 +0100
@@ -124,7 +124,7 @@
 
         log.debug('starting parsing %s', parse_limit)
 
-        last_rev = last_rev + 1 if last_rev >= 0 else 0
+        last_rev = last_rev + 1 if last_rev and last_rev >= 0 else 0
         log.debug('Getting revisions from %s to %s',
              last_rev, last_rev + parse_limit
         )
@@ -142,8 +142,7 @@
                 except ValueError:
                     time_pos = None
 
-                if time_pos >= 0 and time_pos is not None:
-
+                if time_pos is not None and time_pos >= 0:
                     datadict = \
                         co_day_auth_aggr[akc(cs.author)]['data'][time_pos]