Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions crud.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from time import time

from lnbits.db import Database
from lnbits.helpers import urlsafe_short_hash

Expand Down Expand Up @@ -38,8 +40,11 @@ async def get_games_by_user(user: str) -> list[Game]:

async def get_all_pending_games() -> list[Game]:
return await db.fetchall(
"SELECT * FROM numberlottery.games WHERE completed = :c AND closing_date < :t",
{"c": False, "t": db.timestamp_now},
f"""
SELECT * FROM numberlottery.games WHERE completed = :c
AND closing_date < {db.timestamp_placeholder('now')}
""",
{"c": False, "now": time()},
Game,
)

Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ authors = [{ name = "Alan Bits", email = "alan@lnbits.com" }]
urls = { Homepage = "https://lnbits.com", Repository = "https://github.com/lnbits/numberlottery" }
dependencies = [ "lnbits>1" ]

[tool.poetry]
package-mode = false

[tool.uv]
dev-dependencies = [
[dependency-groups]
dev = [
"black",
"pytest-asyncio",
"pytest",
Expand All @@ -21,6 +18,9 @@ dev-dependencies = [
"pytest-md",
]

[tool.poetry]
package-mode = false

[tool.mypy]
plugins = ["pydantic.mypy"]

Expand Down