changed to shortuuid as suggested by Vlad
This commit is contained in:
parent
6c9a52c6e1
commit
7322d27aa3
1 changed files with 3 additions and 1 deletions
|
|
@ -4,6 +4,8 @@ from typing import Any, Dict, List, Optional
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
|
|
||||||
|
import shortuuid
|
||||||
|
|
||||||
from lnbits import bolt11
|
from lnbits import bolt11
|
||||||
from lnbits.db import COCKROACH, POSTGRES, Connection
|
from lnbits.db import COCKROACH, POSTGRES, Connection
|
||||||
from lnbits.settings import AdminSettings, EditableSettings, SuperSettings, settings
|
from lnbits.settings import AdminSettings, EditableSettings, SuperSettings, settings
|
||||||
|
|
@ -627,7 +629,7 @@ async def create_admin_settings(super_user: str, new_settings: dict):
|
||||||
|
|
||||||
|
|
||||||
async def create_tinyurl(domain: str, endless: bool, conn: Optional[Connection] = None):
|
async def create_tinyurl(domain: str, endless: bool, conn: Optional[Connection] = None):
|
||||||
tinyurl_id = uuid4().hex[:8]
|
tinyurl_id = shortuuid.uuid()[:8]
|
||||||
await (conn or db).execute(
|
await (conn or db).execute(
|
||||||
f"INSERT INTO tiny_url (id, url, endless) VALUES (?, ?, ?)",
|
f"INSERT INTO tiny_url (id, url, endless) VALUES (?, ?, ?)",
|
||||||
(
|
(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue