mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-02-23 14:40:47 +01:00
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 uuid import uuid4
|
||||
|
||||
import shortuuid
|
||||
|
||||
from lnbits import bolt11
|
||||
from lnbits.db import COCKROACH, POSTGRES, Connection
|
||||
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):
|
||||
tinyurl_id = uuid4().hex[:8]
|
||||
tinyurl_id = shortuuid.uuid()[:8]
|
||||
await (conn or db).execute(
|
||||
f"INSERT INTO tiny_url (id, url, endless) VALUES (?, ?, ?)",
|
||||
(
|
||||
|
|
Loading…
Add table
Reference in a new issue