Fix update validations (#30)
* fix: no `username` update * fix: update for old pay_links * chore: code format
This commit is contained in:
parent
8bad631fb6
commit
257f5d34d2
9 changed files with 252 additions and 94 deletions
3
crud.py
3
crud.py
|
|
@ -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"])
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue