Skip to content

Commit 25f3217

Browse files
Raid : handling both prices (#816)
### Description Please explain the changes you made here. ### Checklist - [ ] Created tests which fail without the change (if possible) - [ ] All tests passing - [ ] Extended the documentation, if necessary --------- Co-authored-by: Armand Didierjean <[email protected]>
1 parent badb2a2 commit 25f3217

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

app/modules/raid/utils/utils_raid.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,21 @@ async def validate_payment(
8888
raise RaidPayementError(checkout_id)
8989
participant_id = participant_checkout.participant_id
9090
prices = await get_core_data(coredata_raid.RaidPrice, db)
91-
if prices.student_price and paid_amount == prices.student_price:
91+
if (prices.student_price and paid_amount == prices.student_price) or (
92+
prices.external_price and paid_amount == prices.external_price
93+
):
9294
await cruds_raid.confirm_payment(participant_id, db)
9395
elif prices.t_shirt_price and paid_amount == prices.t_shirt_price:
9496
await cruds_raid.confirm_t_shirt_payment(participant_id, db)
95-
elif (
96-
prices.student_price
97-
and prices.t_shirt_price
98-
and paid_amount == prices.student_price + prices.t_shirt_price
97+
elif prices.t_shirt_price and (
98+
(
99+
prices.student_price
100+
and paid_amount == prices.student_price + prices.t_shirt_price
101+
)
102+
or (
103+
prices.external_price
104+
and paid_amount == prices.external_price + prices.t_shirt_price
105+
)
99106
):
100107
await cruds_raid.confirm_payment(participant_id, db)
101108
await cruds_raid.confirm_t_shirt_payment(participant_id, db)

0 commit comments

Comments
 (0)