Skip to content

Commit 420ac73

Browse files
committed
add fixes
1 parent ac7bdb1 commit 420ac73

3 files changed

Lines changed: 31 additions & 29 deletions

File tree

td/client.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
from td.app.auth import FlaskTDAuth
2525
from td.oauth import run
2626
from td.oauth import shutdown
27-
from td.exceptions import TknExpError, ExdLmtError, NotNulError, \
28-
ForbidError, NotFndError, ServerError, GeneralError
27+
from td.exceptions import TknExpError, ExdLmtError, NotNulError, ForbidError, NotFndError, ServerError, GeneralError
2928

3029
class TDClient():
3130

@@ -1162,8 +1161,11 @@ def get_transactions(self, account: str = None, transaction_type: str = None, sy
11621161
'endDate': end_date
11631162
}
11641163

1164+
if account is None and self.account_number:
1165+
account = self.account_number
1166+
11651167
# define the endpoint
1166-
endpoint = '/accounts/{}/transactions'.format(account)
1168+
endpoint = 'accounts/{}/transactions'.format(account)
11671169

11681170
# return the response of the get request.
11691171
return self._make_request(method='get', endpoint=endpoint, params=params)

td/fields.py

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@
1616
}
1717

1818
VALID_CHART_VALUES = {
19-
'minute':{
20-
'day':[1, 2, 3, 4, 5, 10]
19+
'minute': {
20+
'day': [1, 2, 3, 4, 5, 10]
2121
},
22-
'daily':{
23-
'month':[1, 2, 3, 6],
24-
'year':[1, 2, 3, 5, 10, 15, 20],
25-
'ytd':[1]
22+
'daily': {
23+
'month': [1, 2, 3, 6],
24+
'year': [1, 2, 3, 5, 10, 15, 20],
25+
'ytd': [1]
2626
},
27-
'weekly':{
28-
'month':[1, 2, 3, 6],
29-
'year':[1, 2, 3, 5, 10, 15, 20],
30-
'ytd':[1]
27+
'weekly': {
28+
'month': [1, 2, 3, 6],
29+
'year': [1, 2, 3, 5, 10, 15, 20],
30+
'ytd': [1]
3131
},
32-
'monthly':{
33-
'year':[1, 2, 3, 5, 10, 15, 20]
32+
'monthly': {
33+
'year': [1, 2, 3, 5, 10, 15, 20]
3434
}
3535
}
3636

@@ -346,21 +346,21 @@
346346

347347

348348
CSV_FIELD_KEYS = {
349-
"ACTIVES_NASDAQ":{
350-
"key":"key",
351-
"1":"data"
349+
"ACTIVES_NASDAQ": {
350+
"key": "key",
351+
"1": "data"
352352
},
353-
"ACTIVES_OTCBB":{
354-
"key":"key",
355-
"1":"data"
353+
"ACTIVES_OTCBB": {
354+
"key": "key",
355+
"1": "data"
356356
},
357-
"ACTIVES_NYSE":{
358-
"key":"key",
359-
"1":"data"
357+
"ACTIVES_NYSE": {
358+
"key": "key",
359+
"1": "data"
360360
},
361-
"ACTIVES_OPTIONS":{
362-
"key":"key",
363-
"1":"data"
361+
"ACTIVES_OPTIONS": {
362+
"key": "key",
363+
"1": "data"
364364
},
365365
"CHART_EQUITY": {
366366
"seq": "chart-sequence",
@@ -697,5 +697,5 @@
697697
"NASDAQ_BOOK": "nested",
698698
"OPTIONS_BOOK": "nested",
699699
"LISTED_BOOK": "nested",
700-
"FUTURES_BOOK":"nested"
700+
"FUTURES_BOOK": "nested"
701701
}

td/oauth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def callback():
7171
def refresh():
7272

7373
# Grab the Refresh Token.
74-
refresh_token_dict = app.config['auth_client'].flask_td_auth.grab_refresh_token()
74+
refresh_token_dict = app.config['auth_client'].grab_refresh_token()
7575

7676
return jsonify(refresh_token_dict)
7777

0 commit comments

Comments
 (0)