changeset 8465:617d55f1d518

refactor: replace boolean expr with named function call Replace a confusing boolean expression with a the use_cached_tracker() method call.
author John Rouillard <rouilj@ieee.org>
date Sat, 11 Oct 2025 18:18:54 -0400
parents 72f549e68534
children 2f909acd5ba9
files roundup/cgi/wsgi_handler.py
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/roundup/cgi/wsgi_handler.py	Thu Oct 09 13:49:07 2025 -0400
+++ b/roundup/cgi/wsgi_handler.py	Sat Oct 11 18:18:54 2025 -0400
@@ -97,12 +97,16 @@
         else:
             self.translator = None
 
-        if "cache_tracker" not in self.feature_flags or \
-           self.feature_flags["cache_tracker"] is not False:
+        if self.use_cached_tracker():
             self.tracker = roundup.instance.open(self.home, not self.debug)
         else:
             self.preload()
 
+    def use_cached_tracker(self):
+        return (
+            "cache_tracker" not in self.feature_flags or
+            self.feature_flags["cache_tracker"] is not False)
+
     @gen_trace_id()
     @store_trace_reason("wsgi")
     def __call__(self, environ, start_response):
@@ -135,8 +139,7 @@
         else:
             form = BinaryFieldStorage(fp=environ['wsgi.input'], environ=environ)
 
-        if "cache_tracker" not in self.feature_flags or \
-           self.feature_flags["cache_tracker"] is not False:
+        if self.use_cached_tracker():
             client = self.tracker.Client(self.tracker, request, environ, form,
                                          self.translator)
             try:

Roundup Issue Tracker: http://roundup-tracker.org/