Skip to content

Commit

Permalink
Merge pull request #371 from Kotik112/master
Browse files Browse the repository at this point in the history
Filtered out gift cards from pending_actions_query
  • Loading branch information
BerglundDaniel authored Dec 5, 2023
2 parents 1097470 + ee5d438 commit 99bcd68
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion api/src/shop/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,11 @@ def pending_actions_query(member_id: Optional[int] = None, transaction: Optional
if transaction:
query = query.filter(Transaction.id == transaction.id)

if member_id:
if member_id is not None:
query = query.filter(Transaction.member_id == member_id)
else:
# Exclude transactions with member_id set to None (Gift cards)
query = query.filter(Transaction.member_id.isnot(None))

return query

Expand Down

0 comments on commit 99bcd68

Please sign in to comment.