Merge pull request #2017 from RoboSats/include-more-order-info

Include more order info when there is a password
This commit is contained in:
KoalaSat
2025-06-22 17:42:00 +00:00
committed by GitHub
2 changed files with 2 additions and 5 deletions

View File

@ -257,10 +257,6 @@ class OrderView(viewsets.ViewSet):
if is_penalized: if is_penalized:
data["penalty"] = request.user.robot.penalty_expiration data["penalty"] = request.user.robot.penalty_expiration
# 2.1) If order has a password
if not data["is_participant"] and data["has_password"]:
return Response(data, status.HTTP_200_OK)
# 3.a) If not a participant and order is not public, forbid. # 3.a) If not a participant and order is not public, forbid.
if ( if (
order.maker != request.user order.maker != request.user

View File

@ -508,7 +508,8 @@ class TradeTest(BaseAPITestCase):
data = trade.response.json() data = trade.response.json()
self.assertEqual(trade.response.status_code, 200) self.assertEqual(trade.response.status_code, 200)
self.assertTrue(data["has_password"]) self.assertTrue(data["has_password"])
self.assertNotIn("maker_nick", data) self.assertIsInstance(data["satoshis_now"], int)
self.assertNotIn("is_buyer", data)
# Take with no password # Take with no password
trade.take_order() trade.take_order()