Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
giancarloromeo committed Nov 5, 2024
1 parent 9db58f7 commit d292788
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
_logger = logging.getLogger(__name__)


PaymentMethodIDTypeAdapter: TypeAdapter[PaymentMethodID] = TypeAdapter(PaymentMethodID)


class PaymentsMethodsDB(BaseModel):
payment_method_id: PaymentMethodID
user_id: UserID
Expand Down Expand Up @@ -114,12 +111,12 @@ async def get_pending_payment_methods_ids(
async with get_database_engine(app).acquire() as conn:
result = await conn.execute(
sa.select(payments_methods.c.payment_method_id)
.where(payments_methods.c.completed_at == None) # noqa: E711
.where(payments_methods.c.completed_at.is_(None))
.order_by(payments_methods.c.initiated_at.asc()) # oldest first
)
rows = await result.fetchall() or []
return [
PaymentMethodIDTypeAdapter.validate_python(row.payment_method_id)
TypeAdapter(PaymentMethodID).validate_python(row.payment_method_id)
for row in rows
]

Expand Down

0 comments on commit d292788

Please sign in to comment.