@@ -824,6 +824,16 @@ def ownable_name_by_id(ownable_id):
return current_cursor.fetchone()[0]
+def user_name_by_id(user_id):
+ execute('''
+ SELECT username
+ FROM users
+ WHERE rowid = ?
+ ''', (user_id,))
+
+ return current_cursor.fetchone()[0]
def bank_order(buy, ownable_id, limit, amount, expiry, ioc):
if not limit:
raise AssertionError('The bank does not give away anything.')
@@ -180,7 +180,7 @@ def gift(json_request):
ownable_id,
amount)
- return {'message': "Gift sent."}
+ return {'message': f"Sent {amount} {model.ownable_name_by_id(ownable_id)} to {model.user_name_by_id(recipient_id)}."}
def orders(json_request):