]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/Cryptoportfolio/Trader.git/blobdiff - main.py
Eat several positions in the order book after some time spent
[perso/Immae/Projets/Cryptomonnaies/Cryptoportfolio/Trader.git] / main.py
diff --git a/main.py b/main.py
index ee25182f24d54bd3326bd976d579c07c0ee896df..ab523bec068fa4c00e08de16a1bf54ea7ef378ae 100644 (file)
--- a/main.py
+++ b/main.py
@@ -71,9 +71,9 @@ def fetch_markets(user):
     cursor = dbs.psql.cursor()
 
     if user is None:
-        cursor.execute("SELECT id,config,user_id FROM market_configs")
+        cursor.execute("SELECT id,config,user_id FROM market_configs WHERE status='enabled'")
     else:
-        cursor.execute("SELECT id,config,user_id FROM market_configs WHERE user_id = %s", user)
+        cursor.execute("SELECT id,config,user_id FROM market_configs WHERE status='enabled' AND user_id = %s", [user])
 
     for row in cursor:
         yield row