|
@@ -1,6 +1,5 @@
|
|
|
import json
|
|
|
-from datetime import timedelta
|
|
|
-from time import strptime
|
|
|
+from datetime import timedelta, datetime
|
|
|
|
|
|
from bottle import request, response
|
|
|
import model
|
|
@@ -136,7 +135,8 @@ def order():
|
|
|
if not model.user_owns_at_least(amount, user_id, ownable_id):
|
|
|
return bad_request('You can not sell more than you own.')
|
|
|
try:
|
|
|
- expiry = strptime(model.current_db_time(), '%Y-%m-%d %H:%M:%S') + timedelta(minutes=time_until_expiration)
|
|
|
+ expiry = datetime.strptime(model.current_db_time(), '%Y-%m-%d %H:%M:%S') + \
|
|
|
+ timedelta(minutes=time_until_expiration)
|
|
|
except OverflowError:
|
|
|
return bad_request('The expiration time is too far in the future.')
|
|
|
model.place_order(buy, ownership_id, limit, stop_loss, amount, expiry)
|