diff roundup/cgi/templating.py @ 6422:91ae685405ba

- issue2550964 - History can (temporarily) show incorrect value... when a change is rejected. Fix history function to always use the database values and ignore the current setting in the form.
author John Rouillard <rouilj@ieee.org>
date Wed, 26 May 2021 12:04:06 -0400
parents 9c57f2814597
children 32a04dc87b30
line wrap: on
line diff
--- a/roundup/cgi/templating.py	Sun May 23 18:00:55 2021 -0400
+++ b/roundup/cgi/templating.py	Wed May 26 12:04:06 2021 -0400
@@ -1133,6 +1133,12 @@
         if not self.is_view_ok():
             return self._('[hidden]')
 
+        # history should only use database values not current
+        # form values. Disable form_wins for the body of the
+        # function. Reset it to original value on return.
+        orig_form_wins = self._client.form_wins
+        self._client.form_wins = False
+                
         # get the journal, sort and reverse
         history = self._klass.history(self._nodeid, skipquiet=(not showall))
         history.sort(key=lambda a: a[:3])
@@ -1375,6 +1381,9 @@
              self._('<th>Args</th>'),
             '</tr>']
         l.append('</table>')
+
+        self._client.form_wins = orig_form_wins
+        
         return '\n'.join(l)
 
     def renderQueryForm(self):

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