modified: blueprints/auth.py
modified: blueprints/finance.py modified: core/db.py
This commit is contained in:
@@ -104,15 +104,19 @@ def trigger_sync():
|
||||
try:
|
||||
db_file = current_app.config.get('DB_FILE', '')
|
||||
instance_id = current_app.config.get('INSTANCE_ID', '')
|
||||
server_url = current_app.config.get('SERVER_URL', '')
|
||||
server_url = ''
|
||||
display_name = ''
|
||||
sync_secret = ''
|
||||
if db_file:
|
||||
instance_file = os.path.join(os.path.dirname(db_file), 'instance.json')
|
||||
if os.path.exists(instance_file):
|
||||
with open(instance_file) as f:
|
||||
sync_secret = json.load(f).get('sync_secret', '')
|
||||
cfg = json.load(f)
|
||||
server_url = cfg.get('server_url', '')
|
||||
display_name = cfg.get('display_name', 'Caja Principal')
|
||||
sync_secret = cfg.get('sync_secret', '')
|
||||
if server_url:
|
||||
sm = SyncManager(db_file, instance_id, server_url, current_app.config.get('DISPLAY_NAME', ''), sync_secret)
|
||||
sm = SyncManager(db_file, instance_id, server_url, display_name, sync_secret)
|
||||
sm._push()
|
||||
sm._pull()
|
||||
return jsonify({"status": "ok"})
|
||||
|
||||
Reference in New Issue
Block a user