From 31264e1fe49e1e73738fe34d82fd499be87756cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dni=20=E2=9A=A1?= Date: Fri, 29 Sep 2023 07:22:45 +0200 Subject: [PATCH] fix: latest fastapi (#23) str(url) had to be casted earlier --- models.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/models.py b/models.py index a27e5e1..aae9b1b 100644 --- a/models.py +++ b/models.py @@ -55,14 +55,14 @@ class PayLink(BaseModel): data["max"] /= data["fiat_base_multiplier"] return cls(**data) - def lnurl(self, req: Request) -> str: - url = req.url_for("lnurlp.api_lnurl_response", link_id=self.id) + def lnurl(self, req: Request) -> str: + url = str(req.url_for("lnurlp.api_lnurl_response", link_id=self.id)) # Check if url is .onion and change to http if urlparse(url).netloc.endswith(".onion"): # change url string scheme to http url = url.replace("https://", "http://") - - return lnurl_encode(str(url)) + + return lnurl_encode(url) def success_action(self, payment_hash: str) -> Optional[Dict]: if self.success_url: