Skip to content

Commit d887492

Browse files
committed
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.
1 parent 573e102 commit d887492

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

roundup/admin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,8 @@ def do_initialise(self, tracker_home, args):
520520
tracker.nuke()
521521

522522
# GO
523-
tracker.init(password.Password(adminpw, config=tracker.config))
523+
tracker.init(password.Password(adminpw, config=tracker.config),
524+
tx_Source = 'cli')
524525

525526
return 0
526527

roundup/instance.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,9 @@ def get_extensions(self, dirname):
209209
sys.path.remove(dirpath)
210210
return extensions
211211

212-
def init(self, adminpw):
212+
def init(self, adminpw, tx_Source=None):
213213
db = self.open('admin')
214+
db.tx_Source = tx_Source
214215
self._execfile('initial_data.py', {'db': db, 'adminpw': adminpw,
215216
'admin_email': self.config['ADMIN_EMAIL']})
216217
db.commit()

0 commit comments

Comments
 (0)