Filter crypto payment history by shop
- Add shop_id filtering to crypto_quotes_history view - Only show payments for the current shop context - Maintains user privacy by filtering cross-shop payments
This commit is contained in:
parent
3de1abdd7b
commit
f25404eac3
1 changed files with 5 additions and 2 deletions
|
|
@ -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()
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue