Skip to content

Commit 14c05be

Browse files
committed
Partly fix type-checking
1 parent 3f048dc commit 14c05be

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

app/core/myeclpay/endpoints_myeclpay.py

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

2333+
if debited_wallet.user is None:
2334+
hyperion_error_logger.error(
2335+
f"MyECLPay: No UserPayment for debited wallet {debited_wallet.id}, this should never happen",
2336+
)
2337+
raise HTTPException(
2338+
status_code=400,
2339+
detail="MyECLPay: The debited wallet is not associated to a user",
2340+
)
23332341
if debited_wallet.user.id != user.id:
23342342
hyperion_error_logger.error(
23352343
f"MyECLPay: 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/myeclpay/models_myeclpay.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)