diff --git a/make_post_sell/views/crypto.py b/make_post_sell/views/crypto.py index 81039b6..768b4f7 100644 --- a/make_post_sell/views/crypto.py +++ b/make_post_sell/views/crypto.py @@ -796,11 +796,14 @@ def crypto_cancel(request): def crypto_quotes_history(request): """Show user's crypto payment history (all attempts, successful and failed).""" - # Get all crypto payments for this user, ordered by newest first + # Get crypto payments for this user on this shop, ordered by newest first crypto_payments = ( request.dbsession.query(CryptoPayment) .join(CryptoPayment.invoice) - .filter(Invoice.user_id == request.user.id) + .filter( + Invoice.user_id == request.user.id, + Invoice.shop_id == request.shop.id if request.shop else None, + ) .order_by(CryptoPayment.created_timestamp.desc()) .all() )