Skip to content

Commit 87b1cc4

Browse files
committed
Partly fix type-checking
1 parent b02e2eb commit 87b1cc4

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

app/core/mypayment/endpoints_mypayment.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2445,6 +2445,14 @@ async def user_purchase_store(
24452445
detail="Could not find wallet associated with the debited wallet device",
24462446
)
24472447

2448+
if debited_wallet.user is None:
2449+
hyperion_error_logger.error(
2450+
f"MyECLPay: No UserPayment for debited wallet {debited_wallet.id}, this should never happen",
2451+
)
2452+
raise HTTPException(
2453+
status_code=400,
2454+
detail="MyECLPay: The debited wallet is not associated to a user",
2455+
)
24482456
if debited_wallet.user.id != user.id:
24492457
hyperion_error_logger.error(
24502458
f"MyPayment: Mismatch between the user {user.id} who sent the request and the user {debited_wallet.user.id} owning the signatory device, this should never happen",

app/core/mypayment/models_mypayment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ class UsedTransactionRequest(Base):
248248
tot: Mapped[int | None]
249249
iat: Mapped[datetime | None]
250250
key: Mapped[UUID | None]
251-
transaction_type: Mapped[TransactionType.DIRECT | TransactionType.INDIRECT]
251+
transaction_type: Mapped[TransactionType] # Should be DIRECT or DIRECTED
252252
store: Mapped[bool | None]
253253
store_id: Mapped[UUID | None] = mapped_column(
254254
ForeignKey("myeclpay_store.id"),

0 commit comments

Comments
 (0)