diff rhodecode/model/db.py @ 3625:260a7a01b054 beta

follow Python conventions for boolean values True and False might be singletons and the "default" values for "boolean" expressions, but "all" values in Python has a boolean value and should be evaluated as such. Checking with 'is True' and 'is False' is thus confusing, error prone and unnessarily complex. If we anywhere rely and nullable boolean fields from the database layer and don't want the null value to be treated as False then we should check explicitly for null with 'is None'.
author Mads Kiilerich <madski@unity3d.com>
date Thu, 28 Mar 2013 01:10:45 +0100
parents c8ecfe42b285
children 10b4e34841a4
line wrap: on
line diff
--- a/rhodecode/model/db.py	Thu Mar 28 01:10:45 2013 +0100
+++ b/rhodecode/model/db.py	Thu Mar 28 01:10:45 2013 +0100
@@ -1698,7 +1698,7 @@
         cache_key = cls._get_cache_key(key)
         inv = cls._get_or_create_inv_obj(cache_key, repo_name)
 
-        if inv and inv.cache_active is False:
+        if inv and not inv.cache_active:
             return inv
 
     @classmethod