Fix update validations (#30)

* fix: no `username` update
* fix: update for old pay_links
* chore: code format
This commit is contained in:
Vlad Stan 2023-11-02 16:09:32 +02:00 committed by GitHub
commit 257f5d34d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 252 additions and 94 deletions

View file

@ -1,4 +1,3 @@
import re
from typing import List, Optional, Union
from lnbits.helpers import urlsafe_short_hash
@ -105,7 +104,7 @@ async def get_pay_links(wallet_ids: Union[str, List[str]]) -> List[PayLink]:
async def update_pay_link(link_id: str, **kwargs) -> Optional[PayLink]:
if "username" in kwargs and len(kwargs["username"]) > 0:
if "username" in kwargs and len(kwargs["username"] or "") > 0:
await check_lnaddress_format(kwargs["username"])
await check_lnaddress_not_exists(kwargs["username"])