From 672023f539e7b4ddb7de919d830e04d8ab683bfd Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Sun, 12 Feb 2023 00:15:50 +0000 Subject: [PATCH] Log what vending machine purchase was from --- apiserver/apiserver/api/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apiserver/apiserver/api/views.py b/apiserver/apiserver/api/views.py index a91bb25..1d37163 100644 --- a/apiserver/apiserver/api/views.py +++ b/apiserver/apiserver/api/views.py @@ -1242,6 +1242,8 @@ class ProtocoinViewSet(Base): source_card = get_object_or_404(models.Card, card_number=pk) source_user = source_card.user + machine = request.data.get('machine', 'unknown') + try: number = request.data['number'] except KeyError: @@ -1276,8 +1278,9 @@ class ProtocoinViewSet(Base): source_delta = -amount - memo = 'Protocoin - Purchase spent ₱ {} on vending machine item #{}'.format( + memo = 'Protocoin - Purchase spent ₱ {} on {} vending machine item #{}'.format( amount, + machine, number, )