Procházet zdrojové kódy

fix sell quesionts

Eren Yilmaz před 6 roky
rodič
revize
d63c9376ae
1 změnil soubory, kde provedl 3 přidání a 3 odebrání
  1. 3 3
      client_controller.py

+ 3 - 3
client_controller.py

@@ -209,12 +209,12 @@ def buy(amount=None, object_name=None, limit='', stop_loss='', time_until_expira
               'to see if the order has been executed already.')
 
 
-def sell(amount=None, object_name=None, limit=None, stop_loss='', time_until_expiration=None):
+def sell(amount=None, object_name=None, limit='', stop_loss='', time_until_expiration=None):
     if object_name is None:  # TODO list some available objects
         object_name = input('Name of object to sell: ')
     if amount is None:
         amount = input('Amount: ')
-    if limit is None:
+    if limit == '':
         set_limit = yn_dialog('Do you want to place a limit?')
         if set_limit:
             limit = input('Limit: ')
@@ -222,7 +222,7 @@ def sell(amount=None, object_name=None, limit=None, stop_loss='', time_until_exp
         else:
             limit = None
             stop_loss = None
-    if limit is not None and stop_loss == '':
+    if limit != '' and stop_loss == '':
         stop_loss = yn_dialog('Is this a stop-loss limit?')
 
     if time_until_expiration is None: