소스 검색

fix changing passwords

Eren Yilmaz 5 년 전
부모
커밋
bb1c18845a
1개의 변경된 파일8개의 추가작업 그리고 2개의 파일을 삭제
  1. 8 2
      client_controller.py

+ 8 - 2
client_controller.py

@@ -79,6 +79,8 @@ def cancel_order(order_no=None):
 
 
 def change_password(password=None, retype_password=None):
+    if password != retype_password:
+        password = None
     if password is None:
         while True:
             if sys.stdin.isatty():
@@ -186,6 +188,9 @@ def buy(amount=None, object_name=None, limit='', stop_loss='', time_until_expira
         else:
             limit = None
             stop_loss = None
+    if limit is not None and stop_loss == '':
+        stop_loss = yn_dialog('Is this a stop-loss limit?')
+
     if time_until_expiration is None:
         time_until_expiration = input('Time until order expires (minutes, default 60):')
         if time_until_expiration == '':
@@ -204,7 +209,7 @@ 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=None, time_until_expiration=None):
+def sell(amount=None, object_name=None, limit=None, 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:
@@ -213,10 +218,11 @@ def sell(amount=None, object_name=None, limit=None, stop_loss=None, time_until_e
         set_limit = yn_dialog('Do you want to place a limit?')
         if set_limit:
             limit = input('Limit: ')
+            stop_loss = yn_dialog('Is this a stop-loss limit?')
         else:
             limit = None
             stop_loss = None
-    if limit is not None:
+    if limit is not None and stop_loss == '':
         stop_loss = yn_dialog('Is this a stop-loss limit?')
 
     if time_until_expiration is None: