From 137e716bb8335108dd6698e00af4dc1760c8e8b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dni=20=E2=9A=A1?= Date: Mon, 14 Oct 2024 10:19:21 +0200 Subject: [PATCH] clean init admin settings --- lnbits/core/services.py | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/lnbits/core/services.py b/lnbits/core/services.py index a5bb3b54a..8542cfd3c 100644 --- a/lnbits/core/services.py +++ b/lnbits/core/services.py @@ -1,7 +1,6 @@ import asyncio import json import time -from datetime import datetime from io import BytesIO from pathlib import Path from typing import Optional @@ -813,22 +812,16 @@ def update_cached_settings(sets_dict: dict): async def init_admin_settings(super_user: Optional[str] = None) -> SuperSettings: - async def new_account(account_id: str) -> Account: - now = datetime.now() - account = Account( - id=account_id, - extra=UserExtra(provider="env"), - created_at=now, - updated_at=now, - ) - await create_account(account) - return account - account = None if super_user: account = await get_account(super_user) if not account: - account = await new_account(super_user or uuid4().hex) + account_id = super_user or uuid4().hex + account = Account( + id=account_id, + extra=UserExtra(provider="env"), + ) + await create_account(account) await create_wallet(user_id=account.id) editable_settings = EditableSettings.from_dict(settings.dict())