changeset 5216:6a4317738a90

make roundup-admin init function set the transaction source. Otherwise when initial_data.py is loaded as part of init, db.tx_Source is set to None and thus checks like db.tx_Source in [ 'cli' ] will fail.
author John Rouillard <rouilj@ieee.org>
date Wed, 22 Mar 2017 22:03:01 -0400
parents 917e45d9ba08
children 17b213eab274
files roundup/admin.py roundup/instance.py
diffstat 2 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/roundup/admin.py	Mon Mar 20 21:22:28 2017 -0400
+++ b/roundup/admin.py	Wed Mar 22 22:03:01 2017 -0400
@@ -520,7 +520,8 @@
             tracker.nuke()
 
         # GO
-        tracker.init(password.Password(adminpw, config=tracker.config))
+        tracker.init(password.Password(adminpw, config=tracker.config),
+                     tx_Source = 'cli')
 
         return 0
 
--- a/roundup/instance.py	Mon Mar 20 21:22:28 2017 -0400
+++ b/roundup/instance.py	Wed Mar 22 22:03:01 2017 -0400
@@ -209,8 +209,9 @@
             sys.path.remove(dirpath)
         return extensions
 
-    def init(self, adminpw):
+    def init(self, adminpw, tx_Source=None):
         db = self.open('admin')
+        db.tx_Source = tx_Source
         self._execfile('initial_data.py', {'db': db, 'adminpw': adminpw,
             'admin_email': self.config['ADMIN_EMAIL']})
         db.commit()

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