diff roundup/cgi/client.py @ 7815:f11c982f01c8

chore(refactor): extract setting of db.tx_source out of if tree
author John Rouillard <rouilj@ieee.org>
date Sun, 17 Mar 2024 00:51:12 -0400
parents 9adf37c63b56
children f47b186a2ad9
line wrap: on
line diff
--- a/roundup/cgi/client.py	Sat Mar 16 22:57:19 2024 -0400
+++ b/roundup/cgi/client.py	Sun Mar 17 00:51:12 2024 -0400
@@ -1694,18 +1694,17 @@
         # open the database or only set the user
         if not hasattr(self, 'db'):
             self.db = self.instance.open(username)
-            self.db.tx_Source = "web"
         elif self.instance.optimize:
                 self.db.setCurrentUser(username)
-                self.db.tx_Source = "web"
         else:
             self.db.close()
             self.db = self.instance.open(username)
-            self.db.tx_Source = "web"
             # The old session API refers to the closed database;
             # we can no longer use it.
             self.session_api = Session(self)
 
+        self.db.tx_Source = "web"
+
     # match designator in URL stripping leading 0's. So:
     # https://issues.roundup-tracker.org/issue002551190 is the same as
     # https://issues.roundup-tracker.org/issue2551190

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