From 022907bd2c4a72a8a3ce6468823b4a2111c88596 Mon Sep 17 00:00:00 2001
From: Mike McLean <mikem@redhat.com>
Date: Apr 16 2026 15:50:14 +0000
Subject: [PATCH 1/2] make templates compatible for jinja 2.10


---

diff --git a/www/kojiweb/templates/builds.html.j2 b/www/kojiweb/templates/builds.html.j2
index 407e961..c12c431 100644
--- a/www/kojiweb/templates/builds.html.j2
+++ b/www/kojiweb/templates/builds.html.j2
@@ -10,9 +10,9 @@ Latest
 #elif state != None
 {{ util.stateName(state)|capitalize }}
 #endif
-#if draft is false
+#if draft and draft is not sameas none
 Nondraft
-#elif draft is true
+#elif draft
 Draft
 #endif
 #if type
@@ -80,16 +80,16 @@ in tag <a href="taginfo?tagID={{ tag.id }}">{{ tag.name }}</a>
         </td>
         <td>
         <select name="type" class="filterlist" onchange="javascript: window.location='builds?draft=' + this.value + '{{ util.passthrough_except('draft') }}';">
-          <option value="all" {{ 'selected' if draft is none else '' }}>all</option>
-          <option value="1" {{ 'selected' if draft is true else '' }}>yes</option>
-          <option value="0" {{ 'selected' if draft is false else '' }}>no</option>
+          <option value="all" {{ 'selected' if draft is sameas none else '' }}>all</option>
+          <option value="1" {{ 'selected' if draft is sameas true else '' }}>yes</option>
+          <option value="0" {{ 'selected' if draft is sameas false else '' }}>no</option>
         </select>
         </td>
         <td>
         <strong>Content Generator</strong>:
         </td><td>
         <select name="inherited" class="filterlist" onchange="javascript: window.location = 'builds?cg=' + this.value + '{{ util.passthrough_except('cg') }}';">
-          <option value="" {{ 'selected' if cg is none else '' }}>all</option>
+          <option value="" {{ 'selected' if cg is sameas none else '' }}>all</option>
           #for cgname in cgs
           <option value="{{ cgname }}" {{ 'selected' if cg == cgname else '' }}>{{ cgname }}</option>
           #endfor
diff --git a/www/kojiweb/templates/reporequests.html.j2 b/www/kojiweb/templates/reporequests.html.j2
index c97f9f0..741bdc1 100644
--- a/www/kojiweb/templates/reporequests.html.j2
+++ b/www/kojiweb/templates/reporequests.html.j2
@@ -35,7 +35,7 @@
         #if (reqPages |length) > 1
         <form class="pageJump" action="">
           Page:
-          <select onchange="javascript: window.location = 'reporequests?start=' + this.value * {{ reqRange }} + '{{ P(*Pvars) }}';">
+          <select onchange="javascript: window.location = 'reporequests?start=' + this.value * {{ reqRange }} + '{{ P(names=Pvars) }}';">
             #for pageNum in reqPages
             <option value="{{ pageNum }}"{{ ' selected' if pageNum == reqCurrentPage else '' }}>{{ pageNum + 1 }}</option>
             #endfor
@@ -43,20 +43,20 @@
         </form>
         #endif
         #if reqStart > 0
-        <a href="reporequests?start={{ reqStart - reqRange  }}{{ P(*Pvars) }}">&lt;&lt;&lt;</a>
+        <a href="reporequests?start={{ reqStart - reqRange  }}{{ P(names=Pvars) }}">&lt;&lt;&lt;</a>
         #endif
         #if totalReqs != 0
         <strong>Requests {{ reqStart + 1  }} through {{ reqStart + reqCount  }} of {{ totalReqs }}</strong>
         #endif
         #if reqStart + reqCount < totalReqs
-        <a href="reporequests?start={{ reqStart + reqRange }}{{ P(*Pvars) }}">&gt;&gt;&gt;</a>
+        <a href="reporequests?start={{ reqStart + reqRange }}{{ P(names=Pvars) }}">&gt;&gt;&gt;</a>
         #endif
       </td>
     </tr>
     <tr class="list-header">
-      <th><a href="reporequests?{{ P(*Pvars, toggleOrder='id', prefix='') }}">ID</a> {{ util.sortImage('id') }}</th>
-      <th><a href="reporequests?{{ P(*Pvars, toggleOrder='priority', prefix='') }}">Priority</a> {{ util.sortImage('priority') }}</th>
-      <th><a href="reporequests?{{ P(*Pvars, toggleOrder='tag_name', prefix='') }}">Tag</a> {{ util.sortImage('tag_name') }}</th>
+      <th><a href="reporequests?{{ P(names=Pvars, toggleOrder='id', prefix='') }}">ID</a> {{ util.sortImage('id') }}</th>
+      <th><a href="reporequests?{{ P(names=Pvars, toggleOrder='priority', prefix='') }}">Priority</a> {{ util.sortImage('priority') }}</th>
+      <th><a href="reporequests?{{ P(names=Pvars, toggleOrder='tag_name', prefix='') }}">Tag</a> {{ util.sortImage('tag_name') }}</th>
       <th>Task</th>
       <th>Repo</th>
       <th>Status</th>
@@ -104,7 +104,7 @@
         #if (reqPages |length) > 1
         <form class="pageJump" action="">
           Page:
-          <select onchange="javascript: window.location = 'reporequests?start=' + this.value * {{ reqRange }} + '{{ P(*Pvars) }}';">
+          <select onchange="javascript: window.location = 'reporequests?start=' + this.value * {{ reqRange }} + '{{ P(names=Pvars) }}';">
             #for pageNum in reqPages
             <option value="{{ pageNum }}"{{ ' selected' if pageNum == reqCurrentPage else '' }}>{{ pageNum + 1 }}</option>
             #endfor
@@ -112,13 +112,13 @@
         </form>
         #endif
         #if reqStart > 0
-        <a href="reporequests?start={{ reqStart - reqRange  }}{{ P(*Pvars) }}">&lt;&lt;&lt;</a>
+        <a href="reporequests?start={{ reqStart - reqRange  }}{{ P(names=Pvars) }}">&lt;&lt;&lt;</a>
         #endif
         #if totalReqs != 0
         <strong>Reqs {{ reqStart + 1  }} through {{ reqStart + reqCount  }} of {{ totalReqs }}</strong>
         #endif
         #if reqStart + reqCount < totalReqs
-        <a href="reporequests?start={{ reqStart + reqRange }}{{ P(*Pvars) }}">&gt;&gt;&gt;</a>
+        <a href="reporequests?start={{ reqStart + reqRange }}{{ P(names=Pvars) }}">&gt;&gt;&gt;</a>
         #endif
       </td>
     </tr>
diff --git a/www/lib/kojiweb/util.py b/www/lib/kojiweb/util.py
index 2519f9d..1d39169 100644
--- a/www/lib/kojiweb/util.py
+++ b/www/lib/kojiweb/util.py
@@ -353,7 +353,10 @@ def _sortImage(orderVal, sortKey, orderVar):
 
 @safe_return
 @pass_context
-def passthrough(context, *varnames, prefix='&', invert=False, toggleOrder=None):
+def passthrough(context, *varnames, prefix='&', invert=False, toggleOrder=None, names=None):
+    if names is not None:
+        # alternate way to pass list of names
+        varnames += names
     if invert:
         _PASSTHROUGH = context.get('_PASSTHROUGH', None)
         if _PASSTHROUGH is None:

From 532a9de5b94f88434c86319aa968a09655106e37 Mon Sep 17 00:00:00 2001
From: Mike McLean <mikem@redhat.com>
Date: Apr 16 2026 16:12:28 +0000
Subject: [PATCH 2/2] tweak the tests to minimize changes


---

diff --git a/www/kojiweb/templates/builds.html.j2 b/www/kojiweb/templates/builds.html.j2
index c12c431..75f05d7 100644
--- a/www/kojiweb/templates/builds.html.j2
+++ b/www/kojiweb/templates/builds.html.j2
@@ -10,7 +10,7 @@ Latest
 #elif state != None
 {{ util.stateName(state)|capitalize }}
 #endif
-#if draft and draft is not sameas none
+#if draft is sameas false
 Nondraft
 #elif draft
 Draft
@@ -80,8 +80,8 @@ in tag <a href="taginfo?tagID={{ tag.id }}">{{ tag.name }}</a>
         </td>
         <td>
         <select name="type" class="filterlist" onchange="javascript: window.location='builds?draft=' + this.value + '{{ util.passthrough_except('draft') }}';">
-          <option value="all" {{ 'selected' if draft is sameas none else '' }}>all</option>
-          <option value="1" {{ 'selected' if draft is sameas true else '' }}>yes</option>
+          <option value="all" {{ 'selected' if draft is none else '' }}>all</option>
+          <option value="1" {{ 'selected' if draft else '' }}>yes</option>
           <option value="0" {{ 'selected' if draft is sameas false else '' }}>no</option>
         </select>
         </td>
@@ -89,7 +89,7 @@ in tag <a href="taginfo?tagID={{ tag.id }}">{{ tag.name }}</a>
         <strong>Content Generator</strong>:
         </td><td>
         <select name="inherited" class="filterlist" onchange="javascript: window.location = 'builds?cg=' + this.value + '{{ util.passthrough_except('cg') }}';">
-          <option value="" {{ 'selected' if cg is sameas none else '' }}>all</option>
+          <option value="" {{ 'selected' if cg is none else '' }}>all</option>
           #for cgname in cgs
           <option value="{{ cgname }}" {{ 'selected' if cg == cgname else '' }}>{{ cgname }}</option>
           #endfor

