# HG changeset patch # User Mads Kiilerich # Date 1423620300 -3600 # Node ID 319b165182274cbbfc7d65a2e6ffaa09eeddcbd5 # Parent 73effddded5790de8d7479f0f52d08aa867886d9 db: check for None instead of boolean false if that is what we mean If matters a lot whether we find all comments for the specified empty list of changesets or for None meaning the whole repository. diff -r 73effddded57 -r 319b16518227 kallithea/model/db.py --- a/kallithea/model/db.py Wed Feb 11 02:40:28 2015 +0100 +++ b/kallithea/model/db.py Wed Feb 11 03:05:00 2015 +0100 @@ -1222,7 +1222,7 @@ @classmethod def lock(cls, repo, user_id, lock_time=None): - if not lock_time: + if lock_time is not None: lock_time = time.time() repo.locked = [user_id, lock_time] Session().add(repo) @@ -1358,7 +1358,7 @@ """ cmts = ChangesetComment.query()\ .filter(ChangesetComment.repo == self) - if revisions: + if revisions is not None: cmts = cmts.filter(ChangesetComment.revision.in_(revisions)) grouped = collections.defaultdict(list) for cmt in cmts.all(): @@ -2172,9 +2172,9 @@ """ q = Session().query(User)\ .join(ChangesetComment.author) - if revision: + if revision is not None: q = q.filter(cls.revision == revision) - elif pull_request_id: + elif pull_request_id is not None: q = q.filter(cls.pull_request_id == pull_request_id) return q.all()