Skip to content

Commit

Permalink
add fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
areed1192 committed Jul 28, 2020
1 parent ac7bdb1 commit 420ac73
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 29 deletions.
8 changes: 5 additions & 3 deletions td/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
from td.app.auth import FlaskTDAuth
from td.oauth import run
from td.oauth import shutdown
from td.exceptions import TknExpError, ExdLmtError, NotNulError, \
ForbidError, NotFndError, ServerError, GeneralError
from td.exceptions import TknExpError, ExdLmtError, NotNulError, ForbidError, NotFndError, ServerError, GeneralError

class TDClient():

Expand Down Expand Up @@ -1162,8 +1161,11 @@ def get_transactions(self, account: str = None, transaction_type: str = None, sy
'endDate': end_date
}

if account is None and self.account_number:
account = self.account_number

# define the endpoint
endpoint = '/accounts/{}/transactions'.format(account)
endpoint = 'accounts/{}/transactions'.format(account)

# return the response of the get request.
return self._make_request(method='get', endpoint=endpoint, params=params)
Expand Down
50 changes: 25 additions & 25 deletions td/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@
}

VALID_CHART_VALUES = {
'minute':{
'day':[1, 2, 3, 4, 5, 10]
'minute': {
'day': [1, 2, 3, 4, 5, 10]
},
'daily':{
'month':[1, 2, 3, 6],
'year':[1, 2, 3, 5, 10, 15, 20],
'ytd':[1]
'daily': {
'month': [1, 2, 3, 6],
'year': [1, 2, 3, 5, 10, 15, 20],
'ytd': [1]
},
'weekly':{
'month':[1, 2, 3, 6],
'year':[1, 2, 3, 5, 10, 15, 20],
'ytd':[1]
'weekly': {
'month': [1, 2, 3, 6],
'year': [1, 2, 3, 5, 10, 15, 20],
'ytd': [1]
},
'monthly':{
'year':[1, 2, 3, 5, 10, 15, 20]
'monthly': {
'year': [1, 2, 3, 5, 10, 15, 20]
}
}

Expand Down Expand Up @@ -346,21 +346,21 @@


CSV_FIELD_KEYS = {
"ACTIVES_NASDAQ":{
"key":"key",
"1":"data"
"ACTIVES_NASDAQ": {
"key": "key",
"1": "data"
},
"ACTIVES_OTCBB":{
"key":"key",
"1":"data"
"ACTIVES_OTCBB": {
"key": "key",
"1": "data"
},
"ACTIVES_NYSE":{
"key":"key",
"1":"data"
"ACTIVES_NYSE": {
"key": "key",
"1": "data"
},
"ACTIVES_OPTIONS":{
"key":"key",
"1":"data"
"ACTIVES_OPTIONS": {
"key": "key",
"1": "data"
},
"CHART_EQUITY": {
"seq": "chart-sequence",
Expand Down Expand Up @@ -697,5 +697,5 @@
"NASDAQ_BOOK": "nested",
"OPTIONS_BOOK": "nested",
"LISTED_BOOK": "nested",
"FUTURES_BOOK":"nested"
"FUTURES_BOOK": "nested"
}
2 changes: 1 addition & 1 deletion td/oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def callback():
def refresh():

# Grab the Refresh Token.
refresh_token_dict = app.config['auth_client'].flask_td_auth.grab_refresh_token()
refresh_token_dict = app.config['auth_client'].grab_refresh_token()

return jsonify(refresh_token_dict)

Expand Down

0 comments on commit 420ac73

Please sign in to comment.