refactor
This commit is contained in:
parent
b66588d7c9
commit
022a5b79bb
1 changed files with 9 additions and 0 deletions
9
services.py
Normal file
9
services.py
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import re
|
||||
|
||||
|
||||
async def check_lnaddress_format(username: str) -> bool:
|
||||
# check username complies with lnaddress specification
|
||||
if not re.match("^[a-z0-9-_.]{3,15}$", username):
|
||||
assert False, "Only letters a-z0-9-_. allowed, min 3 and max 15 characters!"
|
||||
return
|
||||
return True
|
||||
Loading…
Add table
Add a link
Reference in a new issue