fixed /newtransaction
This commit is contained in:
parent
b347c10653
commit
0c9cc0b4ef
@ -288,6 +288,7 @@ class API_Handler:
|
||||
int: status code
|
||||
"""
|
||||
with r.Session() as s:
|
||||
time = time[:-3] + "Z" # remove last character and add Z to make it a valid date for db
|
||||
headers = {'Authorization': 'Bearer ' + self.token + ":" + str(user_id)}
|
||||
transaction = {"comment": str(comment), "count": float(count), "isin": str(isin), "price": float(price), "time": str(time)} # set transaction as JSON with all the attributes needed according to Swagger docs
|
||||
req = s.post(self.db_adress + "/transaction", json=transaction, headers=headers)
|
||||
|
@ -483,8 +483,8 @@ def set_new_transaction_step(message):
|
||||
amount = float(transaction_data[2])
|
||||
price = float(transaction_data[3])
|
||||
time = dt.datetime.now().isoformat()
|
||||
#print("\n\n\n\n\n")
|
||||
#print(f"{symbol},{amount},{price},{time}")
|
||||
print("\n\n\n\n\n")
|
||||
print(f"{isin},{amount},{price},{time}")
|
||||
status = api_handler.set_transaction(user_id, desc, isin, amount, price, time)
|
||||
|
||||
if status == 200:
|
||||
|
Loading…
Reference in New Issue
Block a user