mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2024-11-20 02:28:10 +01:00
format
This commit is contained in:
parent
8265bbfeb5
commit
4ab5285156
@ -1,6 +1,6 @@
|
|||||||
|
import re
|
||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
import re
|
|
||||||
|
|
||||||
from bech32 import bech32_decode, convertbits
|
from bech32 import bech32_decode, convertbits
|
||||||
from fastapi import Query, Request, Response
|
from fastapi import Query, Request, Response
|
||||||
@ -159,10 +159,11 @@ async def api_address_create(
|
|||||||
status_code=HTTPStatus.NOT_FOUND, detail="You're sneaky, nice try."
|
status_code=HTTPStatus.NOT_FOUND, detail="You're sneaky, nice try."
|
||||||
)
|
)
|
||||||
|
|
||||||
regex = re.compile(r'^[a-z0-9_.]+$')
|
regex = re.compile(r"^[a-z0-9_.]+$")
|
||||||
if not re.fullmatch(regex, post_data.local_part.lower()):
|
if not re.fullmatch(regex, post_data.local_part.lower()):
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=HTTPStatus.NOT_FOUND, detail="Only a-z, 0-9 and .-_ are allowed characters, case insensitive."
|
status_code=HTTPStatus.NOT_FOUND,
|
||||||
|
detail="Only a-z, 0-9 and .-_ are allowed characters, case insensitive.",
|
||||||
)
|
)
|
||||||
|
|
||||||
exists = await get_address_by_local_part(domain_id, post_data.local_part)
|
exists = await get_address_by_local_part(domain_id, post_data.local_part)
|
||||||
|
Loading…
Reference in New Issue
Block a user