diff --git a/crud.py b/crud.py index 21937d0..1989373 100644 --- a/crud.py +++ b/crud.py @@ -24,10 +24,10 @@ async def update_print(_print: Print, conn: Optional[Connection] = None) -> Prin return _print -async def get_print(print_id: str) -> Optional[Print]: +async def get_print(payment_hash: str) -> Optional[Print]: return await db.fetchone( - "SELECT * FROM pay2print.print WHERE id = :id", - {"id": print_id}, + "SELECT * FROM pay2print.print WHERE payment_hash = :payment_hash", + {"payment_hash": payment_hash}, Print, ) diff --git a/models.py b/models.py index 1a590dc..82bce38 100644 --- a/models.py +++ b/models.py @@ -44,7 +44,6 @@ class CreatePrinter(BaseModel): class Print(BaseModel): - id: str = Field(default_factory=urlsafe_short_hash) printer: str payment_hash: str file: str diff --git a/templates/pay2print/photo.html b/templates/pay2print/photo.html index 296563e..86e4d34 100644 --- a/templates/pay2print/photo.html +++ b/templates/pay2print/photo.html @@ -42,7 +42,9 @@

autoplay style="display: none" > -

Device does not support camera!

+

+ Device does not support camera! +