fix: main page and creating a user and a wallet
The wallet page will still not renders correctly, but the backend does create the user his first wallet.
This commit is contained in:
+16
-16
@@ -10,22 +10,6 @@ from pydantic import BaseModel
|
||||
from lnbits.settings import WALLET
|
||||
|
||||
|
||||
class User(BaseModel):
|
||||
id: str
|
||||
email: str
|
||||
extensions: List[str] = []
|
||||
wallets: List["Wallet"] = []
|
||||
password: Optional[str] = None
|
||||
|
||||
@property
|
||||
def wallet_ids(self) -> List[str]:
|
||||
return [wallet.id for wallet in self.wallets]
|
||||
|
||||
def get_wallet(self, wallet_id: str) -> Optional["Wallet"]:
|
||||
w = [wallet for wallet in self.wallets if wallet.id == wallet_id]
|
||||
return w[0] if w else None
|
||||
|
||||
|
||||
class Wallet(BaseModel):
|
||||
id: str
|
||||
name: str
|
||||
@@ -73,6 +57,22 @@ class Wallet(BaseModel):
|
||||
return await get_wallet_payment(self.id, payment_hash)
|
||||
|
||||
|
||||
class User(BaseModel):
|
||||
id: str
|
||||
email: Optional[str] = None
|
||||
extensions: List[str] = []
|
||||
wallets: List[Wallet] = []
|
||||
password: Optional[str] = None
|
||||
|
||||
@property
|
||||
def wallet_ids(self) -> List[str]:
|
||||
return [wallet.id for wallet in self.wallets]
|
||||
|
||||
def get_wallet(self, wallet_id: str) -> Optional["Wallet"]:
|
||||
w = [wallet for wallet in self.wallets if wallet.id == wallet_id]
|
||||
return w[0] if w else None
|
||||
|
||||
|
||||
class Payment(BaseModel):
|
||||
checking_id: str
|
||||
pending: bool
|
||||
|
||||
Reference in New Issue
Block a user